Update m* tests to use entity & device registry fixtures (#103980)

This commit is contained in:
Jan-Philipp Benecke
2023-11-15 10:33:11 +01:00
committed by GitHub
parent 51c1ea85f3
commit 9326ea09a5
46 changed files with 361 additions and 298 deletions
+2 -2
View File
@@ -39,6 +39,8 @@ from tests.common import MockConfigEntry
)
async def test_moon_day(
hass: HomeAssistant,
device_registry: dr.DeviceRegistry,
entity_registry: er.EntityRegistry,
mock_config_entry: MockConfigEntry,
moon_value: float,
native_value: str,
@@ -70,13 +72,11 @@ async def test_moon_day(
STATE_WANING_CRESCENT,
]
entity_registry = er.async_get(hass)
entry = entity_registry.async_get("sensor.moon_phase")
assert entry
assert entry.unique_id == mock_config_entry.entry_id
assert entry.translation_key == "phase"
device_registry = dr.async_get(hass)
assert entry.device_id
device_entry = device_registry.async_get(entry.device_id)
assert device_entry