diff --git a/tests/components/homee/test_init.py b/tests/components/homee/test_init.py index 0b2ae21a8d0..c24cb39295d 100644 --- a/tests/components/homee/test_init.py +++ b/tests/components/homee/test_init.py @@ -18,10 +18,18 @@ from tests.common import MockConfigEntry @pytest.mark.parametrize( - "side_eff", + ("side_eff", "config_entry_state", "active_flows"), [ - HomeeConnectionFailedException("connection timed out"), - HomeeAuthFailedException("wrong username or password"), + ( + HomeeConnectionFailedException("connection timed out"), + ConfigEntryState.SETUP_RETRY, + [], + ), + ( + HomeeAuthFailedException("wrong username or password"), + ConfigEntryState.SETUP_ERROR, + ["reauth"], + ), ], ) async def test_connection_errors( @@ -29,6 +37,8 @@ async def test_connection_errors( mock_homee: MagicMock, mock_config_entry: MockConfigEntry, side_eff: Exception, + config_entry_state: ConfigEntryState, + active_flows: list[str], ) -> None: """Test if connection errors on startup are handled correctly.""" mock_homee.get_access_token.side_effect = side_eff @@ -36,7 +46,11 @@ async def test_connection_errors( await hass.config_entries.async_setup(mock_config_entry.entry_id) - assert mock_config_entry.state is ConfigEntryState.SETUP_RETRY + assert mock_config_entry.state is config_entry_state + + assert [ + flow["context"]["source"] for flow in hass.config_entries.flow.async_progress() + ] == active_flows async def test_connection_listener(