diff --git a/tests/components/husqvarna_automower/test_binary_sensor.py b/tests/components/husqvarna_automower/test_binary_sensor.py index 144dc734025..5500b547853 100644 --- a/tests/components/husqvarna_automower/test_binary_sensor.py +++ b/tests/components/husqvarna_automower/test_binary_sensor.py @@ -20,6 +20,7 @@ from tests.common import ( MockConfigEntry, async_fire_time_changed, load_json_value_fixture, + snapshot_platform, ) @@ -71,13 +72,6 @@ async def test_snapshot_binary_sensor( [Platform.BINARY_SENSOR], ): await setup_integration(hass, mock_config_entry) - entity_entries = er.async_entries_for_config_entry( - entity_registry, mock_config_entry.entry_id + await snapshot_platform( + hass, entity_registry, snapshot, mock_config_entry.entry_id ) - - assert entity_entries - for entity_entry in entity_entries: - assert hass.states.get(entity_entry.entity_id) == snapshot( - name=f"{entity_entry.entity_id}-state" - ) - assert entity_entry == snapshot(name=f"{entity_entry.entity_id}-entry") diff --git a/tests/components/husqvarna_automower/test_device_tracker.py b/tests/components/husqvarna_automower/test_device_tracker.py index d9cab0d5074..015be201ccc 100644 --- a/tests/components/husqvarna_automower/test_device_tracker.py +++ b/tests/components/husqvarna_automower/test_device_tracker.py @@ -10,7 +10,7 @@ from homeassistant.helpers import entity_registry as er from . import setup_integration -from tests.common import MockConfigEntry +from tests.common import MockConfigEntry, snapshot_platform async def test_device_tracker_snapshot( @@ -26,13 +26,6 @@ async def test_device_tracker_snapshot( [Platform.DEVICE_TRACKER], ): await setup_integration(hass, mock_config_entry) - entity_entries = er.async_entries_for_config_entry( - entity_registry, mock_config_entry.entry_id + await snapshot_platform( + hass, entity_registry, snapshot, mock_config_entry.entry_id ) - - assert entity_entries - for entity_entry in entity_entries: - assert hass.states.get(entity_entry.entity_id) == snapshot( - name=f"{entity_entry.entity_id}-state" - ) - assert entity_entry == snapshot(name=f"{entity_entry.entity_id}-entry") diff --git a/tests/components/husqvarna_automower/test_number.py b/tests/components/husqvarna_automower/test_number.py index abf56df1c0b..b66f1965151 100644 --- a/tests/components/husqvarna_automower/test_number.py +++ b/tests/components/husqvarna_automower/test_number.py @@ -13,7 +13,7 @@ from homeassistant.helpers import entity_registry as er from . import setup_integration -from tests.common import MockConfigEntry +from tests.common import MockConfigEntry, snapshot_platform @pytest.mark.usefixtures("entity_registry_enabled_by_default") @@ -65,13 +65,6 @@ async def test_snapshot_number( [Platform.NUMBER], ): await setup_integration(hass, mock_config_entry) - entity_entries = er.async_entries_for_config_entry( - entity_registry, mock_config_entry.entry_id + await snapshot_platform( + hass, entity_registry, snapshot, mock_config_entry.entry_id ) - - assert entity_entries - for entity_entry in entity_entries: - assert hass.states.get(entity_entry.entity_id) == snapshot( - name=f"{entity_entry.entity_id}-state" - ) - assert entity_entry == snapshot(name=f"{entity_entry.entity_id}-entry") diff --git a/tests/components/husqvarna_automower/test_sensor.py b/tests/components/husqvarna_automower/test_sensor.py index 5d304330aca..f54ce9c6275 100644 --- a/tests/components/husqvarna_automower/test_sensor.py +++ b/tests/components/husqvarna_automower/test_sensor.py @@ -21,6 +21,7 @@ from tests.common import ( MockConfigEntry, async_fire_time_changed, load_json_value_fixture, + snapshot_platform, ) @@ -132,13 +133,6 @@ async def test_sensor( [Platform.SENSOR], ): await setup_integration(hass, mock_config_entry) - entity_entries = er.async_entries_for_config_entry( - entity_registry, mock_config_entry.entry_id + await snapshot_platform( + hass, entity_registry, snapshot, mock_config_entry.entry_id ) - - assert entity_entries - for entity_entry in entity_entries: - assert hass.states.get(entity_entry.entity_id) == snapshot( - name=f"{entity_entry.entity_id}-state" - ) - assert entity_entry == snapshot(name=f"{entity_entry.entity_id}-entry") diff --git a/tests/components/husqvarna_automower/test_switch.py b/tests/components/husqvarna_automower/test_switch.py index 8dbb5450db1..aab1128a746 100644 --- a/tests/components/husqvarna_automower/test_switch.py +++ b/tests/components/husqvarna_automower/test_switch.py @@ -23,6 +23,7 @@ from tests.common import ( MockConfigEntry, async_fire_time_changed, load_json_value_fixture, + snapshot_platform, ) @@ -106,13 +107,6 @@ async def test_switch( [Platform.SWITCH], ): await setup_integration(hass, mock_config_entry) - entity_entries = er.async_entries_for_config_entry( - entity_registry, mock_config_entry.entry_id + await snapshot_platform( + hass, entity_registry, snapshot, mock_config_entry.entry_id ) - - assert entity_entries - for entity_entry in entity_entries: - assert hass.states.get(entity_entry.entity_id) == snapshot( - name=f"{entity_entry.entity_id}-state" - ) - assert entity_entry == snapshot(name=f"{entity_entry.entity_id}-entry")