Move Home Connect entry state assertion at tests (#144027)

This commit is contained in:
J. Diego Rodríguez Royo
2025-05-01 23:04:03 +02:00
committed by GitHub
parent abd17d9af9
commit 883ab44437
14 changed files with 2 additions and 94 deletions

View File

@@ -91,7 +91,6 @@ async def test_paired_depaired_devices_flow(
],
)
)
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED
@@ -181,7 +180,6 @@ async def test_connected_devices(
client.get_settings = AsyncMock(side_effect=get_settings_side_effect)
client.get_all_programs = AsyncMock(side_effect=get_all_programs_side_effect)
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED
client.get_settings = get_settings_original_mock
@@ -230,7 +228,6 @@ async def test_switch_entity_availability(
"switch.dishwasher_child_lock",
"switch.dishwasher_program_eco50",
]
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED
@@ -313,7 +310,6 @@ async def test_switch_functionality(
) -> None:
"""Test switch functionality."""
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED
@@ -380,7 +376,6 @@ async def test_program_switch_functionality(
)
client.stop_program = AsyncMock(side_effect=mock_stop_program)
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED
assert hass.states.is_state(entity_id, initial_state)
@@ -488,7 +483,6 @@ async def test_switch_exception_handling(
]
)
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client_with_exception)
assert config_entry.state == ConfigEntryState.LOADED
@@ -532,7 +526,6 @@ async def test_ent_desc_switch_functionality(
) -> None:
"""Test switch functionality - entity description setup."""
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED
@@ -589,7 +582,6 @@ async def test_ent_desc_switch_exception_handling(
for key, value in status.items()
]
)
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client_with_exception)
assert config_entry.state == ConfigEntryState.LOADED
@@ -675,7 +667,6 @@ async def test_power_switch(
]
)
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED
@@ -715,7 +706,6 @@ async def test_power_switch_fetch_off_state_from_current_value(
]
)
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED
@@ -781,7 +771,6 @@ async def test_power_switch_service_validation_errors(
client.get_settings.return_value = ArrayOfSettings([setting])
client.get_setting = AsyncMock(return_value=setting)
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED
@@ -842,7 +831,6 @@ async def test_create_program_switch_deprecation_issue(
},
)
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED
@@ -923,7 +911,6 @@ async def test_program_switch_deprecation_issue_fix(
},
)
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED
@@ -1018,7 +1005,6 @@ async def test_options_functionality(
)
)
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED
assert hass.states.get(entity_id)