mirror of
https://github.com/home-assistant/core.git
synced 2026-05-28 11:16:40 +01:00
Ignore quirks in Tuya snapshot tests
This commit is contained in:
@@ -4,6 +4,7 @@ from collections.abc import Generator
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from tuya_device_handlers import TUYA_QUIRKS_REGISTRY
|
||||
from tuya_sharing import CustomerDevice, Manager
|
||||
|
||||
from homeassistant.components.tuya.const import (
|
||||
@@ -139,3 +140,13 @@ def notification_helper(
|
||||
) -> TuyaNotificationHelper:
|
||||
"""Fixture for Tuya NotificationHelper."""
|
||||
return TuyaNotificationHelper(hass, mock_manager)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def no_quirk() -> Generator[None]:
|
||||
"""Fixture to bypass all quirk registration."""
|
||||
with (
|
||||
patch.dict(TUYA_QUIRKS_REGISTRY._quirks, clear=True),
|
||||
patch("homeassistant.components.tuya.coordinator.register_tuya_quirks"),
|
||||
):
|
||||
yield
|
||||
|
||||
@@ -33,6 +33,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -24,7 +24,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
|
||||
@pytest.mark.usefixtures("entity_registry_enabled_by_default", "no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -23,7 +23,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
|
||||
@pytest.mark.usefixtures("entity_registry_enabled_by_default", "no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -35,6 +35,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -53,6 +53,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -41,6 +41,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -25,6 +25,7 @@ def platform_autouse():
|
||||
|
||||
|
||||
@pytest.mark.freeze_time("2023-11-01 13:14:15+01:00")
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -31,6 +31,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -31,6 +31,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -108,6 +108,7 @@ async def test_registry_cleanup_multiple_entries(
|
||||
assert entity_registry.async_get(second_entity_id)
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_device_registry(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -32,6 +32,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -35,6 +35,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -30,6 +30,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -31,7 +31,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
|
||||
@pytest.mark.usefixtures("entity_registry_enabled_by_default", "no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -29,6 +29,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -29,6 +29,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -33,6 +33,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
@@ -29,6 +29,7 @@ def platform_autouse():
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("no_quirk")
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: Manager,
|
||||
|
||||
Reference in New Issue
Block a user