1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-27 14:31:13 +00:00

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

View File

@@ -32,7 +32,7 @@ async def test_user(hass, spider):
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"
with patch(
@@ -45,7 +45,7 @@ async def test_user(hass, spider):
)
await hass.async_block_till_done()
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert result["title"] == DOMAIN
assert result["data"][CONF_USERNAME] == USERNAME
assert result["data"][CONF_PASSWORD] == PASSWORD
@@ -72,7 +72,7 @@ async def test_import(hass, spider):
)
await hass.async_block_till_done()
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert result["title"] == DOMAIN
assert result["data"][CONF_USERNAME] == USERNAME
assert result["data"][CONF_PASSWORD] == PASSWORD
@@ -91,7 +91,7 @@ async def test_abort_if_already_setup(hass, spider):
DOMAIN, context={"source": config_entries.SOURCE_USER}, data=SPIDER_USER_DATA
)
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["type"] == data_entry_flow.FlowResultType.ABORT
assert result["reason"] == "single_instance_allowed"
# Should fail, config exist (flow)
@@ -99,5 +99,5 @@ async def test_abort_if_already_setup(hass, spider):
DOMAIN, context={"source": config_entries.SOURCE_IMPORT}, data=SPIDER_USER_DATA
)
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["type"] == data_entry_flow.FlowResultType.ABORT
assert result["reason"] == "single_instance_allowed"