mirror of
https://github.com/home-assistant/core.git
synced 2025-12-25 05:26:47 +00:00
Use is in enum comparison in config flow tests K-O (#114672)
This commit is contained in:
committed by
GitHub
parent
3875533f95
commit
5d500cb74b
@@ -5,11 +5,11 @@ from unittest.mock import patch
|
||||
from nextdns import ApiError, InvalidApiKeyError
|
||||
import pytest
|
||||
|
||||
from homeassistant import data_entry_flow
|
||||
from homeassistant.components.nextdns.const import CONF_PROFILE_ID, DOMAIN
|
||||
from homeassistant.config_entries import SOURCE_USER
|
||||
from homeassistant.const import CONF_API_KEY, CONF_PROFILE_NAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.data_entry_flow import FlowResultType
|
||||
|
||||
from . import PROFILES, init_integration
|
||||
|
||||
@@ -19,7 +19,7 @@ async def test_form_create_entry(hass: HomeAssistant) -> None:
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_USER}
|
||||
)
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["step_id"] == "user"
|
||||
assert result["errors"] == {}
|
||||
|
||||
@@ -37,7 +37,7 @@ async def test_form_create_entry(hass: HomeAssistant) -> None:
|
||||
{CONF_API_KEY: "fake_api_key"},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["step_id"] == "profiles"
|
||||
|
||||
result = await hass.config_entries.flow.async_configure(
|
||||
@@ -45,7 +45,7 @@ async def test_form_create_entry(hass: HomeAssistant) -> None:
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert result["type"] is FlowResultType.CREATE_ENTRY
|
||||
assert result["title"] == "Fake Profile"
|
||||
assert result["data"][CONF_API_KEY] == "fake_api_key"
|
||||
assert result["data"][CONF_PROFILE_ID] == "xyz12"
|
||||
@@ -97,5 +97,5 @@ async def test_form_already_configured(hass: HomeAssistant) -> None:
|
||||
result["flow_id"], {CONF_PROFILE_NAME: "Fake Profile"}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.FlowResultType.ABORT
|
||||
assert result["type"] is FlowResultType.ABORT
|
||||
assert result["reason"] == "already_configured"
|
||||
|
||||
Reference in New Issue
Block a user