Use is in enum comparison in config flow tests P-T (#114675)
This commit is contained in:
parent
5d500cb74b
commit
ee66f6ec8c
164 changed files with 1919 additions and 1890 deletions
|
@ -29,7 +29,7 @@ async def test_full_user_flow_implementation(hass: HomeAssistant) -> None:
|
|||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_USER}
|
||||
)
|
||||
assert result.get("type") == FlowResultType.FORM
|
||||
assert result.get("type") is FlowResultType.FORM
|
||||
assert result.get("errors") == {}
|
||||
|
||||
with (
|
||||
|
@ -61,7 +61,7 @@ async def test_integration_already_exists(hass: HomeAssistant) -> None:
|
|||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_USER}
|
||||
)
|
||||
assert result.get("type") == FlowResultType.ABORT
|
||||
assert result.get("type") is FlowResultType.ABORT
|
||||
assert result.get("reason") == "single_instance_allowed"
|
||||
|
||||
|
||||
|
@ -80,7 +80,7 @@ async def test_user_flow_bad_dsn(hass: HomeAssistant) -> None:
|
|||
{"dsn": "foo"},
|
||||
)
|
||||
|
||||
assert result2.get("type") == FlowResultType.FORM
|
||||
assert result2.get("type") is FlowResultType.FORM
|
||||
assert result2.get("errors") == {"base": "bad_dsn"}
|
||||
|
||||
|
||||
|
@ -99,7 +99,7 @@ async def test_user_flow_unknown_exception(hass: HomeAssistant) -> None:
|
|||
{"dsn": "foo"},
|
||||
)
|
||||
|
||||
assert result2.get("type") == FlowResultType.FORM
|
||||
assert result2.get("type") is FlowResultType.FORM
|
||||
assert result2.get("errors") == {"base": "unknown"}
|
||||
|
||||
|
||||
|
@ -117,7 +117,7 @@ async def test_options_flow(hass: HomeAssistant) -> None:
|
|||
|
||||
result = await hass.config_entries.options.async_init(entry.entry_id)
|
||||
|
||||
assert result.get("type") == FlowResultType.FORM
|
||||
assert result.get("type") is FlowResultType.FORM
|
||||
assert result.get("step_id") == "init"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
|
@ -134,7 +134,7 @@ async def test_options_flow(hass: HomeAssistant) -> None:
|
|||
},
|
||||
)
|
||||
|
||||
assert result.get("type") == FlowResultType.CREATE_ENTRY
|
||||
assert result.get("type") is FlowResultType.CREATE_ENTRY
|
||||
assert result.get("data") == {
|
||||
CONF_ENVIRONMENT: "Test",
|
||||
CONF_EVENT_CUSTOM_COMPONENTS: True,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue