Split the Airzone user flow init from its data (#180767)

This commit is contained in:
Franck Nijhof
2026-08-30 13:05:32 +02:00
committed by GitHub
parent f6b8444b2a
commit 76d4e0d8eb
+27 -3
View File
@@ -130,7 +130,15 @@ async def test_form_invalid_system_id(hass: HomeAssistant) -> None:
),
):
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}, data=USER_INPUT
DOMAIN, context={"source": SOURCE_USER}
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input=USER_INPUT,
)
assert result["type"] is FlowResultType.FORM
@@ -177,7 +185,15 @@ async def test_form_duplicated_id(hass: HomeAssistant) -> None:
config_entry.add_to_hass(hass)
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}, data=USER_INPUT
DOMAIN, context={"source": SOURCE_USER}
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input=USER_INPUT,
)
assert result["type"] is FlowResultType.ABORT
@@ -192,7 +208,15 @@ async def test_connection_error(hass: HomeAssistant) -> None:
side_effect=AirzoneError,
):
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}, data=USER_INPUT
DOMAIN, context={"source": SOURCE_USER}
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input=USER_INPUT,
)
assert result["errors"] == {"base": "cannot_connect"}