Use registry fixtures in tests (s) (#118295)

This commit is contained in:
epenet 2024-05-28 15:41:03 +02:00 committed by GitHub
parent 90500c4b97
commit e58d060f82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 377 additions and 318 deletions

View file

@ -154,15 +154,15 @@ async def test_unload_entry(hass: HomeAssistant, get_data: SensiboData) -> None:
async def test_device_remove_devices(
hass: HomeAssistant,
device_registry: dr.DeviceRegistry,
entity_registry: er.EntityRegistry,
load_int: ConfigEntry,
hass_ws_client: WebSocketGenerator,
) -> None:
"""Test we can only remove a device that no longer exists."""
assert await async_setup_component(hass, "config", {})
registry: er.EntityRegistry = er.async_get(hass)
entity = registry.entities["climate.hallway"]
entity = entity_registry.entities["climate.hallway"]
device_registry = dr.async_get(hass)
device_entry = device_registry.async_get(entity.device_id)
client = await hass_ws_client(hass)
response = await client.remove_device(device_entry.id, load_int.entry_id)