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

This commit is contained in:
Franck Nijhof 2022-07-07 21:28:18 +02:00 committed by GitHub
parent 46beae9061
commit a6244eea28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
142 changed files with 1463 additions and 1849 deletions

View file

@ -6,11 +6,7 @@ import pytest
from homeassistant.components.sun.const import DOMAIN
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import (
RESULT_TYPE_ABORT,
RESULT_TYPE_CREATE_ENTRY,
RESULT_TYPE_FORM,
)
from homeassistant.data_entry_flow import FlowResultType
from tests.common import MockConfigEntry
@ -21,7 +17,7 @@ async def test_full_user_flow(hass: HomeAssistant) -> None:
DOMAIN, context={"source": SOURCE_USER}
)
assert result.get("type") == RESULT_TYPE_FORM
assert result.get("type") == FlowResultType.FORM
assert result.get("step_id") == SOURCE_USER
assert "flow_id" in result
@ -34,7 +30,7 @@ async def test_full_user_flow(hass: HomeAssistant) -> None:
user_input={},
)
assert result.get("type") == RESULT_TYPE_CREATE_ENTRY
assert result.get("type") == FlowResultType.CREATE_ENTRY
assert result.get("title") == "Sun"
assert result.get("data") == {}
assert result.get("options") == {}
@ -55,7 +51,7 @@ async def test_single_instance_allowed(
DOMAIN, context={"source": source}
)
assert result.get("type") == RESULT_TYPE_ABORT
assert result.get("type") == FlowResultType.ABORT
assert result.get("reason") == "single_instance_allowed"
@ -69,7 +65,7 @@ async def test_import_flow(
data={},
)
assert result.get("type") == RESULT_TYPE_CREATE_ENTRY
assert result.get("type") == FlowResultType.CREATE_ENTRY
assert result.get("title") == "Sun"
assert result.get("data") == {}
assert result.get("options") == {}