Update k-l* tests to use entity & device registry fixtures (#103929)
This commit is contained in:
parent
1a3475ea60
commit
0eafc8f2cd
34 changed files with 141 additions and 111 deletions
|
@ -14,7 +14,6 @@ from homeassistant.config_entries import ConfigEntryState
|
|||
from homeassistant.const import ATTR_ENTITY_ID
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||
from homeassistant.helpers.entity_registry import EntityRegistry
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from .common import CONFIG, VACUUM_ENTITY_ID, remove_device
|
||||
|
@ -73,17 +72,19 @@ async def test_entry_not_setup(
|
|||
|
||||
|
||||
async def test_device_remove_devices(
|
||||
hass: HomeAssistant, hass_ws_client: WebSocketGenerator, mock_account: MagicMock
|
||||
hass: HomeAssistant,
|
||||
hass_ws_client: WebSocketGenerator,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
entity_registry: er.EntityRegistry,
|
||||
mock_account: MagicMock,
|
||||
) -> None:
|
||||
"""Test we can only remove a device that no longer exists."""
|
||||
assert await async_setup_component(hass, "config", {})
|
||||
config_entry = await setup_integration(hass, mock_account, VACUUM_DOMAIN)
|
||||
|
||||
registry: EntityRegistry = er.async_get(hass)
|
||||
entity = registry.entities[VACUUM_ENTITY_ID]
|
||||
entity = entity_registry.entities[VACUUM_ENTITY_ID]
|
||||
assert entity.unique_id == "LR3C012345-litter_box"
|
||||
|
||||
device_registry = dr.async_get(hass)
|
||||
device_entry = device_registry.async_get(entity.device_id)
|
||||
assert (
|
||||
await remove_device(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue