Adjust homekit_controller tests which create devices (#98194)
This commit is contained in:
parent
e1e4b0dcf0
commit
b11dc50f9e
1 changed files with 4 additions and 2 deletions
|
@ -97,10 +97,12 @@ async def test_migrate_device_id_no_serial_skip_if_other_owner(
|
||||||
Create a device registry entry that needs migrate, but belongs to a different
|
Create a device registry entry that needs migrate, but belongs to a different
|
||||||
config entry. It should be ignored.
|
config entry. It should be ignored.
|
||||||
"""
|
"""
|
||||||
|
entry = MockConfigEntry()
|
||||||
|
entry.add_to_hass(hass)
|
||||||
device_registry = dr.async_get(hass)
|
device_registry = dr.async_get(hass)
|
||||||
|
|
||||||
bridge = device_registry.async_get_or_create(
|
bridge = device_registry.async_get_or_create(
|
||||||
config_entry_id="XX",
|
config_entry_id=entry.entry_id,
|
||||||
identifiers=variant.before,
|
identifiers=variant.before,
|
||||||
manufacturer="RYSE Inc.",
|
manufacturer="RYSE Inc.",
|
||||||
model="RYSE SmartBridge",
|
model="RYSE SmartBridge",
|
||||||
|
@ -115,7 +117,7 @@ async def test_migrate_device_id_no_serial_skip_if_other_owner(
|
||||||
bridge = device_registry.async_get(bridge.id)
|
bridge = device_registry.async_get(bridge.id)
|
||||||
|
|
||||||
assert bridge.identifiers == variant.before
|
assert bridge.identifiers == variant.before
|
||||||
assert bridge.config_entries == {"XX"}
|
assert bridge.config_entries == {entry.entry_id}
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("variant", DEVICE_MIGRATION_TESTS)
|
@pytest.mark.parametrize("variant", DEVICE_MIGRATION_TESTS)
|
||||||
|
|
Loading…
Add table
Reference in a new issue