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
237 changed files with 2284 additions and 2280 deletions
+4 -4
View File
@@ -17,7 +17,7 @@ async def test_abort_already_setup(hass):
)
result = await flow.async_step_user()
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["type"] == data_entry_flow.FlowResultType.ABORT
assert result["reason"] == "single_instance_allowed"
@@ -29,7 +29,7 @@ async def test_invalid_login_error(hass):
with patch("pyvesync.vesync.VeSync.login", return_value=False):
result = await flow.async_step_user(user_input=test_dict)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["errors"] == {"base": "invalid_auth"}
@@ -38,11 +38,11 @@ async def test_config_flow_user_input(hass):
flow = config_flow.VeSyncFlowHandler()
flow.hass = hass
result = await flow.async_step_user()
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == data_entry_flow.FlowResultType.FORM
with patch("pyvesync.vesync.VeSync.login", return_value=True):
result = await flow.async_step_user(
{CONF_USERNAME: "user", CONF_PASSWORD: "pass"}
)
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert result["data"][CONF_USERNAME] == "user"
assert result["data"][CONF_PASSWORD] == "pass"