Use registry fixtures in tests (z) (#118300)

This commit is contained in:
epenet
2024-05-28 18:25:49 +02:00
committed by GitHub
parent 106cb4cfb7
commit 0b2aac8f4c
26 changed files with 526 additions and 372 deletions
+10 -6
View File
@@ -21,6 +21,7 @@ MULTILEVEL_SWITCH_SELECT_ENTITY = "select.front_door_siren"
async def test_default_tone_select(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
client: MagicMock,
aeotec_zw164_siren: Node,
integration: ConfigEntry,
@@ -64,7 +65,6 @@ async def test_default_tone_select(
"30DOOR~1 (27 sec)",
]
entity_registry = er.async_get(hass)
entity_entry = entity_registry.async_get(DEFAULT_TONE_SELECT_ENTITY)
assert entity_entry
@@ -118,6 +118,7 @@ async def test_default_tone_select(
async def test_protection_select(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
client: MagicMock,
inovelli_lzw36: Node,
integration: ConfigEntry,
@@ -135,7 +136,6 @@ async def test_protection_select(
"NoOperationPossible",
]
entity_registry = er.async_get(hass)
entity_entry = entity_registry.async_get(PROTECTION_SELECT_ENTITY)
assert entity_entry
@@ -298,17 +298,21 @@ async def test_multilevel_switch_select_no_value(
async def test_config_parameter_select(
hass: HomeAssistant, climate_adc_t3000, integration
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
climate_adc_t3000,
integration,
) -> None:
"""Test config parameter select is created."""
select_entity_id = "select.adc_t3000_hvac_system_type"
ent_reg = er.async_get(hass)
entity_entry = ent_reg.async_get(select_entity_id)
entity_entry = entity_registry.async_get(select_entity_id)
assert entity_entry
assert entity_entry.disabled
assert entity_entry.entity_category == EntityCategory.CONFIG
updated_entry = ent_reg.async_update_entity(select_entity_id, disabled_by=None)
updated_entry = entity_registry.async_update_entity(
select_entity_id, disabled_by=None
)
assert updated_entry != entity_entry
assert updated_entry.disabled is False