Split the Peblar user flow init from its data (#180653)

This commit is contained in:
Franck Nijhof
2026-08-29 18:41:06 +02:00
committed by GitHub
parent 6a6f9301a3
commit a1f7924904
+18 -6
View File
@@ -66,9 +66,15 @@ async def test_user_flow_errors(
mock_peblar.login.side_effect = side_effect
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data={
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: "127.0.0.1",
CONF_PASSWORD: "OMGCATS!",
},
@@ -105,9 +111,15 @@ async def test_user_flow_already_configured(
mock_config_entry.add_to_hass(hass)
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data={
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: "127.0.0.1",
CONF_PASSWORD: "OMGSPIDERS",
},