mirror of
https://github.com/home-assistant/core.git
synced 2026-09-24 23:41:48 -05:00
Split the Agent DVR user flow init from its data (#180796)
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user