Use is in ConfigEntryState enum comparison in tests (N-Z) (#114926)

This commit is contained in:
epenet 2024-04-05 17:37:00 +02:00 committed by GitHub
parent f2c091fe0c
commit 9204ccfa17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
107 changed files with 332 additions and 321 deletions

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 setup_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()
@ -31,7 +31,7 @@ async def test_async_setup_entry_not_ready(
"""Test that it throws ConfigEntryNotReady when exception occurs during setup."""
entry = await setup_integration(hass, aioclient_mock, connection_error=True)
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(
mock_connection_invalid_auth(aioclient_mock)
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)