File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -281,7 +281,7 @@ async def test_ssdp_flow_success(hass: HomeAssistant) -> None:
281281async def test_ssdp_flow_cannot_connect (
282282 hass : HomeAssistant , mock_victron_hub : MagicMock
283283) -> None :
284- """Test SSDP discovery flow when connection fails, falls back to user flow ."""
284+ """Test SSDP discovery flow when connection fails, aborts with cannot_connect ."""
285285 mock_victron_hub .return_value .connect .side_effect = CannotConnectError
286286
287287 discovery_info = SsdpServiceInfo (
@@ -304,9 +304,9 @@ async def test_ssdp_flow_cannot_connect(
304304 data = discovery_info ,
305305 )
306306
307- # Should fall back to user form when connection fails
308- assert result ["type" ] is FlowResultType .FORM
309- assert result ["step_id " ] == "user "
307+ # Should abort when connection fails
308+ assert result ["type" ] is FlowResultType .ABORT
309+ assert result ["reason " ] == "cannot_connect "
310310
311311
312312@pytest .mark .usefixtures ("mock_victron_hub" )
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ async def mqtt_test_setup(hass: HomeAssistant):
9797 from custom_components .victron_mqtt .time import async_setup_entry as time_setup_entry
9898
9999 victron_hub = await create_mocked_hub ()
100- mock_async_add_entities = AsyncMock ()
100+ mock_async_add_entities = MagicMock ()
101101
102102 # Create a real Hub and config entry
103103 mock_config_entry = MagicMock (spec = ConfigEntry )
You can’t perform that action at this time.
0 commit comments