mirror of
https://github.com/home-assistant/core.git
synced 2026-05-04 11:54:35 +02:00
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642)
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user