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

@@ -46,7 +46,6 @@ async def test_entry_setup(
integration_setup: Callable[[MagicMock], Awaitable[bool]],
) -> None:
"""Test setup and unload."""
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED
@@ -182,7 +181,6 @@ async def test_client_error(
"""Test client errors during setup integration."""
client_with_exception.get_home_appliances.return_value = None
client_with_exception.get_home_appliances.side_effect = exception
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert not await integration_setup(client_with_exception)
assert config_entry.state == expected_state
assert client_with_exception.get_home_appliances.call_count == 1
@@ -239,7 +237,6 @@ async def test_required_program_or_at_least_an_option(
) -> None:
"Test that the set_program_and_options does raise an exception if no program nor options are set."
assert config_entry.state == ConfigEntryState.NOT_LOADED
assert await integration_setup(client)
assert config_entry.state == ConfigEntryState.LOADED