Split the PoolSense user flow init from its data (#180685)

This commit is contained in:
Franck Nijhof
2026-08-29 21:16:53 +02:00
committed by GitHub
parent a9fbc0d986
commit 915d135c66
+18 -6
View File
@@ -47,9 +47,15 @@ async def test_invalid_credentials(
"""Test we handle invalid credentials."""
mock_poolsense_client.test_poolsense_credentials.return_value = False
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data={CONF_EMAIL: "test@test.com", CONF_PASSWORD: "test"},
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_EMAIL: "test@test.com", CONF_PASSWORD: "test"},
)
assert result["type"] is FlowResultType.FORM
@@ -73,9 +79,15 @@ async def test_duplicate_entry(
"""Test we can't add the same entry twice."""
mock_config_entry.add_to_hass(hass)
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data={CONF_EMAIL: "test@test.com", CONF_PASSWORD: "test"},
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_EMAIL: "test@test.com", CONF_PASSWORD: "test"},
)
await hass.async_block_till_done()