Use is in enum comparison in config flow tests F-J (#114670)
* Use right enum expression F-J * Fix
This commit is contained in:
parent
ea2bb24484
commit
906d3198e3
93 changed files with 1240 additions and 1220 deletions
|
@ -27,7 +27,7 @@ async def test_full_user_flow(hass: HomeAssistant, tmp_path: Path) -> None:
|
|||
DOMAIN, context={"source": SOURCE_USER}
|
||||
)
|
||||
|
||||
assert result.get("type") == FlowResultType.FORM
|
||||
assert result.get("type") is FlowResultType.FORM
|
||||
assert result.get("step_id") == "user"
|
||||
|
||||
result2 = await hass.config_entries.flow.async_configure(
|
||||
|
@ -35,7 +35,7 @@ async def test_full_user_flow(hass: HomeAssistant, tmp_path: Path) -> None:
|
|||
user_input={CONF_FILE_PATH: test_file},
|
||||
)
|
||||
|
||||
assert result2.get("type") == FlowResultType.CREATE_ENTRY
|
||||
assert result2.get("type") is FlowResultType.CREATE_ENTRY
|
||||
assert result2.get("title") == TEST_FILE_NAME
|
||||
assert result2.get("data") == {CONF_FILE_PATH: test_file}
|
||||
|
||||
|
@ -53,7 +53,7 @@ async def test_unique_path(
|
|||
DOMAIN, context={"source": SOURCE_USER}, data={CONF_FILE_PATH: test_file}
|
||||
)
|
||||
|
||||
assert result.get("type") == FlowResultType.ABORT
|
||||
assert result.get("type") is FlowResultType.ABORT
|
||||
assert result.get("reason") == "already_configured"
|
||||
|
||||
|
||||
|
@ -66,7 +66,7 @@ async def test_flow_fails_on_validation(hass: HomeAssistant, tmp_path: Path) ->
|
|||
DOMAIN, context={"source": SOURCE_USER}
|
||||
)
|
||||
|
||||
assert result["type"] == FlowResultType.FORM
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["step_id"] == "user"
|
||||
|
||||
result2 = await hass.config_entries.flow.async_configure(
|
||||
|
@ -103,7 +103,7 @@ async def test_flow_fails_on_validation(hass: HomeAssistant, tmp_path: Path) ->
|
|||
},
|
||||
)
|
||||
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["type"] is FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == TEST_FILE_NAME
|
||||
assert result2["data"] == {
|
||||
CONF_FILE_PATH: test_file,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue