Search/replace RESULT_TYPE_* by FlowResultType enum (#74642)

This commit is contained in:
Franck Nijhof 2022-07-07 18:57:36 +02:00 committed by GitHub
parent 68ccb96089
commit 7cd68381f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
237 changed files with 2284 additions and 2280 deletions

View file

@ -16,7 +16,7 @@ async def test_duplicate_error(hass, config, config_entry):
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}, data=config
)
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["type"] == data_entry_flow.FlowResultType.ABORT
assert result["reason"] == "already_configured"
@ -95,13 +95,13 @@ async def test_options_flow(hass, config, config_entry):
):
await hass.config_entries.async_setup(config_entry.entry_id)
result = await hass.config_entries.options.async_init(config_entry.entry_id)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "init"
result = await hass.config_entries.options.async_configure(
result["flow_id"], user_input={CONF_ZONE_RUN_TIME: 600}
)
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert config_entry.options == {CONF_ZONE_RUN_TIME: 600}
@ -112,7 +112,7 @@ async def test_show_form(hass):
context={"source": config_entries.SOURCE_USER},
data=None,
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "user"
@ -123,7 +123,7 @@ async def test_step_user(hass, config, setup_rainmachine):
context={"source": config_entries.SOURCE_USER},
data=config,
)
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert result["title"] == "12345"
assert result["data"] == {
CONF_IP_ADDRESS: "192.168.1.100",
@ -158,7 +158,7 @@ async def test_step_homekit_zeroconf_ip_already_exists(
),
)
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["type"] == data_entry_flow.FlowResultType.ABORT
assert result["reason"] == "already_configured"
@ -184,7 +184,7 @@ async def test_step_homekit_zeroconf_ip_change(hass, client, config_entry, sourc
),
)
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["type"] == data_entry_flow.FlowResultType.ABORT
assert result["reason"] == "already_configured"
assert config_entry.data[CONF_IP_ADDRESS] == "192.168.1.2"
@ -213,7 +213,7 @@ async def test_step_homekit_zeroconf_new_controller_when_some_exist(
),
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "user"
with patch(
@ -231,7 +231,7 @@ async def test_step_homekit_zeroconf_new_controller_when_some_exist(
)
await hass.async_block_till_done()
assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result2["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert result2["title"] == "12345"
assert result2["data"] == {
CONF_IP_ADDRESS: "192.168.1.100",
@ -261,7 +261,7 @@ async def test_discovery_by_homekit_and_zeroconf_same_time(hass, client):
),
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "user"
with patch(
@ -281,5 +281,5 @@ async def test_discovery_by_homekit_and_zeroconf_same_time(hass, client):
),
)
assert result2["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result2["type"] == data_entry_flow.FlowResultType.ABORT
assert result2["reason"] == "already_in_progress"