Skip to content

Commit 5e68ef0

Browse files
committed
Fix tests
1 parent 617f2d1 commit 5e68ef0

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

tests/test_config_flow.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ async def test_ssdp_flow_success(hass: HomeAssistant) -> None:
281281
async 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")

tests/test_hub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)