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

@ -3,7 +3,7 @@ from unittest.mock import patch
from homeassistant.components.raspberry_pi.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import RESULT_TYPE_ABORT, RESULT_TYPE_CREATE_ENTRY
from homeassistant.data_entry_flow import FlowResultType
from tests.common import MockConfigEntry, MockModule, mock_integration
@ -20,7 +20,7 @@ async def test_config_flow(hass: HomeAssistant) -> None:
DOMAIN, context={"source": "system"}
)
assert result["type"] == RESULT_TYPE_CREATE_ENTRY
assert result["type"] == FlowResultType.CREATE_ENTRY
assert result["title"] == "Raspberry Pi"
assert result["data"] == {}
assert result["options"] == {}
@ -53,6 +53,6 @@ async def test_config_flow_single_entry(hass: HomeAssistant) -> None:
DOMAIN, context={"source": "system"}
)
assert result["type"] == RESULT_TYPE_ABORT
assert result["type"] == FlowResultType.ABORT
assert result["reason"] == "single_instance_allowed"
mock_setup_entry.assert_not_called()