mirror of
https://github.com/home-assistant/core.git
synced 2026-09-03 20:12:16 +01:00
Split the eGauge user flow init from its data (#180747)
This commit is contained in:
@@ -73,9 +73,15 @@ async def test_user_flow_errors(
|
||||
mock_egauge_client.get_device_serial_number.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: "192.168.1.100",
|
||||
CONF_USERNAME: "admin",
|
||||
CONF_PASSWORD: "wrong",
|
||||
@@ -119,9 +125,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: "http://192.168.1.200",
|
||||
CONF_USERNAME: "admin",
|
||||
CONF_PASSWORD: "secret",
|
||||
|
||||
Reference in New Issue
Block a user