Sfoglia il codice sorgente

Tests: remove obsolete entity enabling from mock configs.

Jason Rumney 3 anni fa
parent
commit
8da67346c3

+ 0 - 1
tests/test_binary_sensor.py

@@ -18,7 +18,6 @@ async def test_init_entry(hass):
         data={
             CONF_TYPE: "goldair_dehumidifier",
             CONF_DEVICE_ID: "dummy",
-            "humidifier": False,
         },
     )
     m_add_entities = Mock()

+ 3 - 4
tests/test_climate.py

@@ -16,7 +16,7 @@ async def test_init_entry(hass):
     """Test the initialisation."""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "heater", CONF_DEVICE_ID: "dummy", CONF_CLIMATE: True},
+        data={CONF_TYPE: "heater", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use
@@ -41,7 +41,6 @@ async def test_init_entry(hass):
 #         data={
 #             CONF_TYPE: "goldair_dehumidifier",
 #             CONF_DEVICE_ID: "dummy",
-#             "climate_dehumidifier_as_climate": True,
 #         },
 #     )
 #     # although async, the async_add_entities function passed to
@@ -66,7 +65,7 @@ async def test_init_entry_fails_if_device_has_no_climate(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "kogan_switch", CONF_DEVICE_ID: "dummy", CONF_CLIMATE: True},
+        data={CONF_TYPE: "kogan_switch", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use
@@ -89,7 +88,7 @@ async def test_init_entry_fails_if_config_is_missing(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy", CONF_CLIMATE: True},
+        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use

+ 2 - 3
tests/test_cover.py

@@ -18,7 +18,6 @@ async def test_init_entry(hass):
         data={
             CONF_TYPE: "garage_door_opener",
             CONF_DEVICE_ID: "dummy",
-            "cover": True,
         },
     )
     m_add_entities = Mock()
@@ -38,7 +37,7 @@ async def test_init_entry_fails_if_device_has_no_cover(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "kogan_heater", CONF_DEVICE_ID: "dummy", "cover": True},
+        data={CONF_TYPE: "kogan_heater", CONF_DEVICE_ID: "dummy"},
     )
     m_add_entities = Mock()
     m_device = AsyncMock()
@@ -60,7 +59,7 @@ async def test_init_entry_fails_if_config_is_missing(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy", "cover": True},
+        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use

+ 3 - 4
tests/test_fan.py

@@ -16,7 +16,7 @@ async def test_init_entry(hass):
     """Test the initialisation."""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "goldair_fan", CONF_DEVICE_ID: "dummy", CONF_FAN: True},
+        data={CONF_TYPE: "goldair_fan", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use
@@ -40,7 +40,6 @@ async def test_init_entry_as_secondary(hass):
         data={
             CONF_TYPE: "goldair_dehumidifier",
             CONF_DEVICE_ID: "dummy",
-            CONF_FAN: True,
         },
     )
     # although async, the async_add_entities function passed to
@@ -62,7 +61,7 @@ async def test_init_entry_fails_if_device_has_no_fan(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "kogan_heater", CONF_DEVICE_ID: "dummy", CONF_FAN: True},
+        data={CONF_TYPE: "kogan_heater", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use
@@ -85,7 +84,7 @@ async def test_init_entry_fails_if_config_is_missing(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy", CONF_FAN: True},
+        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use

+ 0 - 3
tests/test_humidifier.py

@@ -19,7 +19,6 @@ async def test_init_entry(hass):
         data={
             CONF_TYPE: "dehumidifier",
             CONF_DEVICE_ID: "dummy",
-            CONF_HUMIDIFIER: True,
         },
     )
     # although async, the async_add_entities function passed to
@@ -44,7 +43,6 @@ async def test_init_entry_fails_if_device_has_no_humidifier(hass):
         data={
             CONF_TYPE: "kogan_heater",
             CONF_DEVICE_ID: "dummy",
-            CONF_HUMIDIFIER: True,
         },
     )
     # although async, the async_add_entities function passed to
@@ -71,7 +69,6 @@ async def test_init_entry_fails_if_config_is_missing(hass):
         data={
             CONF_TYPE: "non_existing",
             CONF_DEVICE_ID: "dummy",
-            CONF_HUMIDIFIER: True,
         },
     )
     # although async, the async_add_entities function passed to

+ 2 - 4
tests/test_light.py

@@ -3,7 +3,6 @@ from pytest_homeassistant_custom_component.common import MockConfigEntry
 from unittest.mock import AsyncMock, Mock
 
 from custom_components.tuya_local.const import (
-    CONF_LIGHT,
     CONF_DEVICE_ID,
     CONF_TYPE,
     DOMAIN,
@@ -19,7 +18,6 @@ async def test_init_entry(hass):
         data={
             CONF_TYPE: "goldair_gpph_heater",
             CONF_DEVICE_ID: "dummy",
-            "light_display": True,
         },
     )
     # although async, the async_add_entities function passed to
@@ -41,7 +39,7 @@ async def test_init_entry_fails_if_device_has_no_light(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "kogan_switch", CONF_DEVICE_ID: "dummy", CONF_LIGHT: True},
+        data={CONF_TYPE: "kogan_switch", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use
@@ -64,7 +62,7 @@ async def test_init_entry_fails_if_config_is_missing(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy", CONF_LIGHT: True},
+        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use

+ 2 - 3
tests/test_lock.py

@@ -19,7 +19,6 @@ async def test_init_entry(hass):
         data={
             CONF_TYPE: "goldair_gpph_heater",
             CONF_DEVICE_ID: "dummy",
-            "lock_child_lock": True,
         },
     )
     # although async, the async_add_entities function passed to
@@ -41,7 +40,7 @@ async def test_init_entry_fails_if_device_has_no_lock(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "kogan_switch", CONF_DEVICE_ID: "dummy", CONF_LOCK: True},
+        data={CONF_TYPE: "kogan_switch", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use
@@ -64,7 +63,7 @@ async def test_init_entry_fails_if_config_is_missing(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy", CONF_LOCK: True},
+        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use

+ 2 - 4
tests/test_number.py

@@ -18,8 +18,6 @@ async def test_init_entry(hass):
         data={
             CONF_TYPE: "goldair_gpph_heater",
             CONF_DEVICE_ID: "dummy",
-            "climate": False,
-            "number_timer": True,
         },
     )
     m_add_entities = Mock()
@@ -38,7 +36,7 @@ async def test_init_entry_fails_if_device_has_no_number(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "simple_switch", CONF_DEVICE_ID: "dummy", "number": True},
+        data={CONF_TYPE: "simple_switch", CONF_DEVICE_ID: "dummy"},
     )
     m_add_entities = Mock()
     m_device = AsyncMock()
@@ -58,7 +56,7 @@ async def test_init_entry_fails_if_config_is_missing(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy", "number": True},
+        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy"},
     )
     m_add_entities = Mock()
     m_device = AsyncMock()

+ 2 - 4
tests/test_select.py

@@ -18,8 +18,6 @@ async def test_init_entry(hass):
         data={
             CONF_TYPE: "arlec_fan",
             CONF_DEVICE_ID: "dummy",
-            "fan": False,
-            "select_timer": True,
         },
     )
     m_add_entities = Mock()
@@ -38,7 +36,7 @@ async def test_init_entry_fails_if_device_has_no_select(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "simple_switch", CONF_DEVICE_ID: "dummy", "select": True},
+        data={CONF_TYPE: "simple_switch", CONF_DEVICE_ID: "dummy"},
     )
     m_add_entities = Mock()
     m_device = AsyncMock()
@@ -58,7 +56,7 @@ async def test_init_entry_fails_if_config_is_missing(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy", "select": True},
+        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy"},
     )
     m_add_entities = Mock()
     m_device = AsyncMock()

+ 1 - 5
tests/test_sensor.py

@@ -18,9 +18,6 @@ async def test_init_entry(hass):
         data={
             CONF_TYPE: "goldair_dehumidifier",
             CONF_DEVICE_ID: "dummy",
-            "humidifier": False,
-            "sensor_current_temperature": True,
-            "sensor_current_humidity": False,
         },
     )
     m_add_entities = Mock()
@@ -45,7 +42,6 @@ async def test_init_entry_fails_if_device_has_no_sensor(hass):
         data={
             CONF_TYPE: "mirabella_genio_usb",
             CONF_DEVICE_ID: "dummy",
-            "sensor": True,
         },
     )
     m_add_entities = Mock()
@@ -66,7 +62,7 @@ async def test_init_entry_fails_if_config_is_missing(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy", "sensor": True},
+        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy"},
     )
     m_add_entities = Mock()
     m_device = AsyncMock()

+ 4 - 4
tests/test_switch.py

@@ -16,7 +16,7 @@ async def test_init_entry(hass):
     """Test the initialisation."""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "kogan_switch", CONF_DEVICE_ID: "dummy", CONF_SWITCH: True},
+        data={CONF_TYPE: "kogan_switch", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use
@@ -37,7 +37,7 @@ async def test_init_entry_as_secondary(hass):
     """Test the initialisation."""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "deta_fan", CONF_DEVICE_ID: "dummy", "switch_master": True},
+        data={CONF_TYPE: "deta_fan", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use
@@ -58,7 +58,7 @@ async def test_init_entry_fails_if_device_has_no_switch(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "kogan_heater", CONF_DEVICE_ID: "dummy", CONF_SWITCH: True},
+        data={CONF_TYPE: "kogan_heater", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use
@@ -81,7 +81,7 @@ async def test_init_entry_fails_if_config_is_missing(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy", CONF_SWITCH: True},
+        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use

+ 2 - 3
tests/test_vacuum.py

@@ -17,7 +17,6 @@ async def test_init_entry(hass):
         data={
             CONF_TYPE: "lefant_m213_vacuum",
             CONF_DEVICE_ID: "dummy",
-            "vacuum": True,
         },
     )
     m_add_entities = Mock()
@@ -38,7 +37,7 @@ async def test_init_entry_fails_if_device_has_no_vacuum(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "kogan_heater", CONF_DEVICE_ID: "dummy", "vacuum": True},
+        data={CONF_TYPE: "kogan_heater", CONF_DEVICE_ID: "dummy"},
     )
     m_add_entities = Mock()
     m_device = AsyncMock()
@@ -60,7 +59,7 @@ async def test_init_entry_fails_if_config_is_missing(hass):
     """Test initialisation when device has no matching entity"""
     entry = MockConfigEntry(
         domain=DOMAIN,
-        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy", "vacuum": True},
+        data={CONF_TYPE: "non_existing", CONF_DEVICE_ID: "dummy"},
     )
     # although async, the async_add_entities function passed to
     # async_setup_entry is called truly asynchronously. If we use