Skip to content

Commit 23d3382

Browse files
committed
Improve failing config_flow test
1 parent 5c21263 commit 23d3382

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/components/plugwise_usb/test_config_flow.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,20 @@ async def test_user_flow_select(hass):
6060
DOMAIN,
6161
context={CONF_SOURCE: SOURCE_USER},
6262
)
63-
result = await hass.config_entries.flow.async_configure(
63+
assert result.get("type") == FlowResultType.FORM
64+
assert result.get("errors") == {}
65+
assert result.get("step_id") == "user"
66+
67+
result_2 = await hass.config_entries.flow.async_configure(
6468
result["flow_id"], user_input={CONF_USB_PATH: port_select}
6569
)
66-
assert result.get("type") is FlowResultType.FORM
67-
assert result.get("user_input") == {CONF_USB_PATH: TEST_USBPORT}
70+
await hass.async_block_till_done()
71+
72+
assert result_2.get("type") == FlowResultType.FORM
73+
assert result_2.get("data") == {CONF_USB_PATH: TEST_USBPORT}
74+
75+
assert len(mock_setup_entry.mock_calls) == 1
76+
assert len(mock_smile_config_flow.connect.mock_calls) == 1
6877

6978
# Retry to ensure configuring the same port is not allowed
7079
result = await hass.config_entries.flow.async_init(

0 commit comments

Comments
 (0)