mirror of
https://github.com/home-assistant/core.git
synced 2026-09-25 07:51:46 -05:00
Split the Tailwind user flow init from its data (#180648)
This commit is contained in:
@@ -72,9 +72,15 @@ async def test_user_flow_errors(
|
||||
mock_tailwind.status.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_TOKEN: "987654",
|
||||
},
|
||||
@@ -109,9 +115,15 @@ async def test_user_flow_unsupported_firmware_version(
|
||||
"""Test configuration flow aborts when the firmware version is not supported."""
|
||||
mock_tailwind.status.side_effect = TailwindUnsupportedFirmwareVersionError
|
||||
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_TOKEN: "987654",
|
||||
},
|
||||
@@ -133,9 +145,15 @@ async def test_user_flow_already_configured(
|
||||
assert mock_config_entry.data[CONF_HOST] == "127.0.0.127"
|
||||
|
||||
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_TOKEN: "987654",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user