Update a-c* tests to use entity & device registry fixtures (#103793)

* Update a-c* tests to use entity & device registry fixtures

* Revert some changes

* Revert formatting

* retrigger CI
This commit is contained in:
Jan-Philipp Benecke 2023-11-12 19:45:30 +01:00 committed by GitHub
parent abb1328a67
commit 9ab1cb83d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 239 additions and 161 deletions

View file

@ -98,7 +98,9 @@ def gate_fixture():
return (feature, "cover.gatecontroller_position")
async def test_init_gatecontroller(gatecontroller, hass: HomeAssistant) -> None:
async def test_init_gatecontroller(
gatecontroller, hass: HomeAssistant, device_registry: dr.DeviceRegistry
) -> None:
"""Test gateController default state."""
_, entity_id = gatecontroller
@ -118,7 +120,6 @@ async def test_init_gatecontroller(gatecontroller, hass: HomeAssistant) -> None:
assert ATTR_CURRENT_POSITION not in state.attributes
assert state.state == STATE_UNKNOWN
device_registry = dr.async_get(hass)
device = device_registry.async_get(entry.device_id)
assert device.name == "My gate controller"
@ -128,7 +129,9 @@ async def test_init_gatecontroller(gatecontroller, hass: HomeAssistant) -> None:
assert device.sw_version == "1.23"
async def test_init_shutterbox(shutterbox, hass: HomeAssistant) -> None:
async def test_init_shutterbox(
shutterbox, hass: HomeAssistant, device_registry: dr.DeviceRegistry
) -> None:
"""Test gateBox default state."""
_, entity_id = shutterbox
@ -148,7 +151,6 @@ async def test_init_shutterbox(shutterbox, hass: HomeAssistant) -> None:
assert ATTR_CURRENT_POSITION not in state.attributes
assert state.state == STATE_UNKNOWN
device_registry = dr.async_get(hass)
device = device_registry.async_get(entry.device_id)
assert device.name == "My shutter"
@ -158,7 +160,9 @@ async def test_init_shutterbox(shutterbox, hass: HomeAssistant) -> None:
assert device.sw_version == "1.23"
async def test_init_gatebox(gatebox, hass: HomeAssistant) -> None:
async def test_init_gatebox(
gatebox, hass: HomeAssistant, device_registry: dr.DeviceRegistry
) -> None:
"""Test cover default state."""
_, entity_id = gatebox
@ -180,7 +184,6 @@ async def test_init_gatebox(gatebox, hass: HomeAssistant) -> None:
assert ATTR_CURRENT_POSITION not in state.attributes
assert state.state == STATE_UNKNOWN
device_registry = dr.async_get(hass)
device = device_registry.async_get(entry.device_id)
assert device.name == "My gatebox"