mirror of
https://github.com/home-assistant/core.git
synced 2026-05-19 23:35:20 +02:00
Update m* tests to use entity & device registry fixtures (#103980)
This commit is contained in:
committed by
GitHub
parent
51c1ea85f3
commit
9326ea09a5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user