1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 17:49:37 +01:00

Use is in ConfigEntryState enum comparison in tests (A-M) (#114925)

This commit is contained in:
epenet
2024-04-05 17:16:55 +02:00
committed by GitHub
parent dd8de14cc5
commit 0b01326f9f
99 changed files with 302 additions and 295 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ from tests.test_util.aiohttp import AiohttpClientMocker
async def test_setup(hass: HomeAssistant, aioclient_mock: AiohttpClientMocker) -> None:
"""Test unload."""
entry = await init_integration(hass, aioclient_mock)
assert entry.state == ConfigEntryState.LOADED
assert entry.state is ConfigEntryState.LOADED
assert await hass.config_entries.async_unload(entry.entry_id)
await hass.async_block_till_done()
@@ -32,7 +32,7 @@ async def test_async_setup_entry_not_ready(hass: HomeAssistant) -> None:
efergymock.side_effect = (exceptions.ConnectError, exceptions.DataError)
await hass.config_entries.async_setup(entry.entry_id)
assert len(hass.config_entries.async_entries(DOMAIN)) == 1
assert entry.state == ConfigEntryState.SETUP_RETRY
assert entry.state is ConfigEntryState.SETUP_RETRY
assert not hass.data.get(DOMAIN)
@@ -43,7 +43,7 @@ async def test_async_setup_entry_auth_failed(hass: HomeAssistant) -> None:
efergymock.side_effect = exceptions.InvalidAuth
await hass.config_entries.async_setup(entry.entry_id)
assert len(hass.config_entries.async_entries(DOMAIN)) == 1
assert entry.state == ConfigEntryState.SETUP_ERROR
assert entry.state is ConfigEntryState.SETUP_ERROR
assert not hass.data.get(DOMAIN)