mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Update m* tests to use entity & device registry fixtures (#103980)
This commit is contained in:
committed by
GitHub
parent
51c1ea85f3
commit
9326ea09a5
@@ -178,7 +178,10 @@ async def test_setup_entry_not_ready(
|
||||
|
||||
|
||||
async def test_entry_migration(
|
||||
hass: HomeAssistant, v1_mock_config_entry: MockConfigEntry
|
||||
hass: HomeAssistant,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
entity_registry: er.EntityRegistry,
|
||||
v1_mock_config_entry: MockConfigEntry,
|
||||
) -> None:
|
||||
"""Test entry migration from version 1 to 3, where host and port is required for the connection to the server."""
|
||||
v1_mock_config_entry.add_to_hass(hass)
|
||||
@@ -218,12 +221,10 @@ async def test_entry_migration(
|
||||
assert migrated_config_entry.state == ConfigEntryState.LOADED
|
||||
|
||||
# Test migrated device entry.
|
||||
device_registry = dr.async_get(hass)
|
||||
device_entry = device_registry.async_get(device_entry_id)
|
||||
assert device_entry.identifiers == {(DOMAIN, migrated_config_entry.entry_id)}
|
||||
|
||||
# Test migrated sensor entity entries.
|
||||
entity_registry = er.async_get(hass)
|
||||
for mapping in sensor_entity_id_key_mapping_list:
|
||||
entity_entry = entity_registry.async_get(mapping["entity_id"])
|
||||
assert (
|
||||
|
||||
Reference in New Issue
Block a user