Split the Agent DVR user flow init from its data (#180796)

This commit is contained in:
Franck Nijhof
2026-08-30 15:22:13 +02:00
committed by GitHub
parent 093ea0af60
commit e4ee263990
+18 -6
View File
@@ -34,9 +34,15 @@ async def test_user_device_exists_abort(
await init_integration(hass, aioclient_mock)
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data={CONF_HOST: "example.local", CONF_PORT: 8090},
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={CONF_HOST: "example.local", CONF_PORT: 8090},
)
assert result["type"] is FlowResultType.ABORT
@@ -50,9 +56,15 @@ async def test_connection_error(
aioclient_mock.get("http://example.local:8090/command.cgi?cmd=getStatus", text="")
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data={CONF_HOST: "example.local", CONF_PORT: 8090},
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={CONF_HOST: "example.local", CONF_PORT: 8090},
)
assert result["errors"]["base"] == "cannot_connect"