1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

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

View File

@@ -28,14 +28,16 @@ async def test_unload_unloads(
assert len(calls) == 1
async def test_remove_entry(hass: HomeAssistant, create_registrations) -> None:
async def test_remove_entry(
hass: HomeAssistant,
device_registry: dr.DeviceRegistry,
entity_registry: er.EntityRegistry,
create_registrations,
) -> None:
"""Test we clean up when we remove entry."""
for config_entry in hass.config_entries.async_entries("mobile_app"):
await hass.config_entries.async_remove(config_entry.entry_id)
assert config_entry.data["webhook_id"] in hass.data[DOMAIN][DATA_DELETED_IDS]
dev_reg = dr.async_get(hass)
assert len(dev_reg.devices) == 0
ent_reg = er.async_get(hass)
assert len(ent_reg.entities) == 0
assert len(device_registry.devices) == 0
assert len(entity_registry.entities) == 0