Use registry fixtures in tests (v-y) (#118299)

This commit is contained in:
epenet 2024-05-28 14:26:14 +02:00 committed by GitHub
parent 8d8696075b
commit f07f183a3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 108 additions and 92 deletions

View file

@ -17,12 +17,13 @@ from . import (
)
async def test_speed_operation(hass: HomeAssistant) -> None:
async def test_speed_operation(
hass: HomeAssistant, entity_registry: er.EntityRegistry
) -> None:
"""Test changing a speed."""
bulb, _ = await async_setup_integration(hass, bulb_type=FAKE_DUAL_HEAD_RGBWW_BULB)
await async_push_update(hass, bulb, {"mac": FAKE_MAC})
entity_id = "number.mock_title_effect_speed"
entity_registry = er.async_get(hass)
assert entity_registry.async_get(entity_id).unique_id == f"{FAKE_MAC}_effect_speed"
assert hass.states.get(entity_id).state == STATE_UNAVAILABLE
@ -40,12 +41,13 @@ async def test_speed_operation(hass: HomeAssistant) -> None:
assert hass.states.get(entity_id).state == "30.0"
async def test_ratio_operation(hass: HomeAssistant) -> None:
async def test_ratio_operation(
hass: HomeAssistant, entity_registry: er.EntityRegistry
) -> None:
"""Test changing a dual head ratio."""
bulb, _ = await async_setup_integration(hass, bulb_type=FAKE_DUAL_HEAD_RGBWW_BULB)
await async_push_update(hass, bulb, {"mac": FAKE_MAC})
entity_id = "number.mock_title_dual_head_ratio"
entity_registry = er.async_get(hass)
assert (
entity_registry.async_get(entity_id).unique_id == f"{FAKE_MAC}_dual_head_ratio"
)