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

@ -66,7 +66,7 @@ async def test_duplicate_error(hass, config, config_entry, data):
result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input=config
)
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["type"] == data_entry_flow.FlowResultType.ABORT
assert result["reason"] == "already_configured"
@ -126,7 +126,7 @@ async def test_errors(hass, data, exc, errors, integration_type):
result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input=data
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["errors"] == errors
@ -183,14 +183,14 @@ async def test_options_flow(hass, 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_SHOW_ON_MAP: False}
)
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert config_entry.options == {CONF_SHOW_ON_MAP: False}
@ -205,7 +205,7 @@ async def test_step_geography_by_coords(hass, config, setup_airvisual):
result["flow_id"], user_input=config
)
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert result["title"] == "Cloud API (51.528308, -0.3817765)"
assert result["data"] == {
CONF_API_KEY: "abcde12345",
@ -237,7 +237,7 @@ async def test_step_geography_by_name(hass, config, setup_airvisual):
result["flow_id"], user_input=config
)
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert result["title"] == "Cloud API (Beijing, Beijing, China)"
assert result["data"] == {
CONF_API_KEY: "abcde12345",
@ -265,7 +265,7 @@ async def test_step_node_pro(hass, config, setup_airvisual):
result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input=config
)
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert result["title"] == "Node/Pro (192.168.1.100)"
assert result["data"] == {
CONF_IP_ADDRESS: "192.168.1.100",
@ -282,7 +282,7 @@ async def test_step_reauth(hass, config_entry, setup_airvisual):
assert result["step_id"] == "reauth_confirm"
result = await hass.config_entries.flow.async_configure(result["flow_id"])
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "reauth_confirm"
new_api_key = "defgh67890"
@ -293,7 +293,7 @@ async def test_step_reauth(hass, config_entry, setup_airvisual):
result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input={CONF_API_KEY: new_api_key}
)
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["type"] == data_entry_flow.FlowResultType.ABORT
assert result["reason"] == "reauth_successful"
assert len(hass.config_entries.async_entries()) == 1
@ -306,7 +306,7 @@ async def test_step_user(hass):
DOMAIN, context={"source": 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_init(
@ -315,7 +315,7 @@ async def test_step_user(hass):
data={"type": INTEGRATION_TYPE_GEOGRAPHY_COORDS},
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "geography_by_coords"
result = await hass.config_entries.flow.async_init(
@ -324,7 +324,7 @@ async def test_step_user(hass):
data={"type": INTEGRATION_TYPE_GEOGRAPHY_NAME},
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "geography_by_name"
result = await hass.config_entries.flow.async_init(
@ -333,5 +333,5 @@ async def test_step_user(hass):
data={"type": INTEGRATION_TYPE_NODE_PRO},
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "node_pro"