Use is in enum comparison in config flow tests F-J (#114670)

* Use right enum expression F-J

* Fix
This commit is contained in:
Joost Lekkerkerker 2024-04-02 23:01:37 +02:00 committed by GitHub
parent ea2bb24484
commit 906d3198e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
93 changed files with 1240 additions and 1220 deletions

View file

@ -16,7 +16,7 @@ async def test_form(hass: HomeAssistant) -> None:
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == FlowResultType.FORM
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == config_entries.SOURCE_USER
with (
@ -38,7 +38,7 @@ async def test_form(hass: HomeAssistant) -> None:
await hass.async_block_till_done()
assert len(mock_setup_entry.mock_calls) == 1
assert result2["type"] == FlowResultType.CREATE_ENTRY
assert result2["type"] is FlowResultType.CREATE_ENTRY
assert result2["data"] == {
"host": "1.1.1.1",
}
@ -50,7 +50,7 @@ async def test_form_auth(hass: HomeAssistant) -> None:
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == FlowResultType.FORM
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
with patch(
@ -63,7 +63,7 @@ async def test_form_auth(hass: HomeAssistant) -> None:
)
await hass.async_block_till_done()
assert result2["type"] == FlowResultType.FORM
assert result2["type"] is FlowResultType.FORM
assert result2["step_id"] == "auth"
with patch(
@ -79,7 +79,7 @@ async def test_form_auth(hass: HomeAssistant) -> None:
)
await hass.async_block_till_done()
assert result3["type"] == FlowResultType.FORM
assert result3["type"] is FlowResultType.FORM
assert result3["step_id"] == "auth"
assert result3["errors"] == {"base": "invalid_auth"}
@ -102,7 +102,7 @@ async def test_form_auth(hass: HomeAssistant) -> None:
)
await hass.async_block_till_done()
assert result4["type"] == FlowResultType.CREATE_ENTRY
assert result4["type"] is FlowResultType.CREATE_ENTRY
assert len(mock_setup_entry.mock_calls) == 1
assert result4["data"] == {
"host": "1.1.1.1",
@ -126,7 +126,7 @@ async def test_form_cannot_connect(hass: HomeAssistant) -> None:
{"host": "1.1.1.1"},
)
assert result2["type"] == FlowResultType.FORM
assert result2["type"] is FlowResultType.FORM
assert result2["errors"] == {"base": "cannot_connect"}
@ -145,5 +145,5 @@ async def test_form_setup_exception(hass: HomeAssistant) -> None:
{"host": "1.1.1.1"},
)
assert result2["type"] == FlowResultType.FORM
assert result2["type"] is FlowResultType.FORM
assert result2["errors"] == {"base": "unknown"}