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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 361 additions and 298 deletions

View file

@ -60,9 +60,10 @@ WALL_ENTITY_ID = "climate.testroom_testwallthermostat"
VALVE_POSITION = "valve_position"
async def test_setup_thermostat(hass: HomeAssistant, cube: MaxCube) -> None:
async def test_setup_thermostat(
hass: HomeAssistant, entity_registry: er.EntityRegistry, cube: MaxCube
) -> None:
"""Test a successful setup of a thermostat device."""
entity_registry = er.async_get(hass)
assert entity_registry.async_is_registered(ENTITY_ID)
entity = entity_registry.async_get(ENTITY_ID)
assert entity.unique_id == "AABBCCDD01"
@ -96,9 +97,10 @@ async def test_setup_thermostat(hass: HomeAssistant, cube: MaxCube) -> None:
assert state.attributes.get(VALVE_POSITION) == 25
async def test_setup_wallthermostat(hass: HomeAssistant, cube: MaxCube) -> None:
async def test_setup_wallthermostat(
hass: HomeAssistant, entity_registry: er.EntityRegistry, cube: MaxCube
) -> None:
"""Test a successful setup of a wall thermostat device."""
entity_registry = er.async_get(hass)
assert entity_registry.async_is_registered(WALL_ENTITY_ID)
entity = entity_registry.async_get(WALL_ENTITY_ID)
assert entity.unique_id == "AABBCCDD02"