From e4ee263990dc8d9b52f831471d5196c6610497d7 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 30 Aug 2026 15:22:13 +0200 Subject: [PATCH] Split the Agent DVR user flow init from its data (#180796) --- .../components/agent_dvr/test_config_flow.py | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/components/agent_dvr/test_config_flow.py b/tests/components/agent_dvr/test_config_flow.py index 88332b833a67..4b935126d825 100644 --- a/tests/components/agent_dvr/test_config_flow.py +++ b/tests/components/agent_dvr/test_config_flow.py @@ -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"