Use area_registry fixture in component tests (#118236)
This commit is contained in:
parent
46158f5c14
commit
fa038bef92
3 changed files with 7 additions and 6 deletions
|
@ -192,10 +192,9 @@ async def test_onboarding_user(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
hass_storage: dict[str, Any],
|
hass_storage: dict[str, Any],
|
||||||
hass_client_no_auth: ClientSessionGenerator,
|
hass_client_no_auth: ClientSessionGenerator,
|
||||||
|
area_registry: ar.AreaRegistry,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test creating a new user."""
|
"""Test creating a new user."""
|
||||||
area_registry = ar.async_get(hass)
|
|
||||||
|
|
||||||
# Create an existing area to mimic an integration creating an area
|
# Create an existing area to mimic an integration creating an area
|
||||||
# before onboarding is done.
|
# before onboarding is done.
|
||||||
area_registry.async_create("Living Room")
|
area_registry.async_create("Living Room")
|
||||||
|
|
|
@ -25,10 +25,11 @@ async def test_async_get_node_status_sensor_entity_id(hass: HomeAssistant) -> No
|
||||||
assert async_get_node_status_sensor_entity_id(hass, device.id) is None
|
assert async_get_node_status_sensor_entity_id(hass, device.id) is None
|
||||||
|
|
||||||
|
|
||||||
async def test_async_get_nodes_from_area_id(hass: HomeAssistant) -> None:
|
async def test_async_get_nodes_from_area_id(
|
||||||
|
hass: HomeAssistant, area_registry: ar.AreaRegistry
|
||||||
|
) -> None:
|
||||||
"""Test async_get_nodes_from_area_id."""
|
"""Test async_get_nodes_from_area_id."""
|
||||||
area_reg = ar.async_get(hass)
|
area = area_registry.async_create("test")
|
||||||
area = area_reg.async_create("test")
|
|
||||||
assert not async_get_nodes_from_area_id(hass, area.id)
|
assert not async_get_nodes_from_area_id(hass, area.id)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -353,6 +353,7 @@ async def test_existing_node_not_replaced_when_not_ready(
|
||||||
zp3111_state,
|
zp3111_state,
|
||||||
client,
|
client,
|
||||||
integration,
|
integration,
|
||||||
|
area_registry: ar.AreaRegistry,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test when a node added event with a non-ready node is received.
|
"""Test when a node added event with a non-ready node is received.
|
||||||
|
|
||||||
|
@ -360,7 +361,7 @@ async def test_existing_node_not_replaced_when_not_ready(
|
||||||
"""
|
"""
|
||||||
dev_reg = dr.async_get(hass)
|
dev_reg = dr.async_get(hass)
|
||||||
er_reg = er.async_get(hass)
|
er_reg = er.async_get(hass)
|
||||||
kitchen_area = ar.async_get(hass).async_create("Kitchen")
|
kitchen_area = area_registry.async_create("Kitchen")
|
||||||
|
|
||||||
device_id = f"{client.driver.controller.home_id}-{zp3111.node_id}"
|
device_id = f"{client.driver.controller.home_id}-{zp3111.node_id}"
|
||||||
device_id_ext = (
|
device_id_ext = (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue