Split the Azure Event Hub user flow init from its data (#180798)

This commit is contained in:
Franck Nijhof
2026-08-30 15:20:34 +02:00
committed by GitHub
parent 2d8de559b9
commit e1b8b1210c
@@ -55,7 +55,15 @@ async def test_form(
) -> None:
"""Test we get the form."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}, data=None
DOMAIN, context={"source": config_entries.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=None,
)
assert result["type"] is FlowResultType.FORM
assert result["errors"] is None
@@ -133,9 +141,15 @@ async def test_connection_error_sas(
) -> None:
"""Test we handle connection errors."""
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": config_entries.SOURCE_USER},
data=BASE_CONFIG_SAS.copy(),
DOMAIN, context={"source": config_entries.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=BASE_CONFIG_SAS.copy(),
)
assert result["type"] is FlowResultType.FORM
assert result["errors"] is None
@@ -162,9 +176,15 @@ async def test_connection_error_cs(
) -> None:
"""Test we handle connection errors."""
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": config_entries.SOURCE_USER},
data=BASE_CONFIG_CS.copy(),
DOMAIN, context={"source": config_entries.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=BASE_CONFIG_CS.copy(),
)
assert result["type"] is FlowResultType.FORM
assert result["errors"] is None