Skip to content

Commit

Permalink
Update test_config_flow.py
Browse files Browse the repository at this point in the history
  • Loading branch information
drc38 authored Dec 26, 2024
1 parent b48176f commit 0fa5d68
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def test_successful_config_flow(hass, bypass_get_data):
)

# Check that the config flow shows the user form as the first step
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "user"

# If a user were to enter form it would result in this function call
Expand All @@ -50,7 +50,7 @@ async def test_successful_config_flow(hass, bypass_get_data):

# Check that the config flow is complete and a new entry is created with
# the input data
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert result["title"] == MOCK_CONFIG[CONF_HOST]
assert result["data"] == MOCK_CONFIG
assert result["result"]
Expand All @@ -67,14 +67,14 @@ async def test_failed_config_flow(hass, error_on_get_data):
DOMAIN, context={"source": config_entries.SOURCE_USER}
)

assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "user"

result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input=MOCK_CONFIG
)

assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["errors"] == {"base": "auth"}


Expand All @@ -91,7 +91,7 @@ async def test_options_flow(hass):
result = await hass.config_entries.options.async_init(entry.entry_id)

# Verify that the first options step is a user form
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "user"

# Enter some fake data into the form
Expand All @@ -101,7 +101,7 @@ async def test_options_flow(hass):
)

# Verify that the flow finishes
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert result["title"] == MOCK_CONFIG[CONF_HOST]

# Verify that the options were updated
Expand Down

0 comments on commit 0fa5d68

Please sign in to comment.