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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
99 changed files with 302 additions and 295 deletions

View file

@ -6,8 +6,8 @@ from unittest.mock import patch
from freezegun.api import FrozenDateTimeFactory
from homeassistant import config_entries
from homeassistant.components.fastdotcom.const import DEFAULT_NAME, DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED, STATE_UNKNOWN
from homeassistant.core import CoreState, HomeAssistant
from homeassistant.helpers import issue_registry as ir
@ -31,10 +31,10 @@ async def test_unload_entry(hass: HomeAssistant) -> None:
await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()
assert config_entry.state == config_entries.ConfigEntryState.LOADED
assert config_entry.state is ConfigEntryState.LOADED
assert await hass.config_entries.async_unload(config_entry.entry_id)
await hass.async_block_till_done()
assert config_entry.state is config_entries.ConfigEntryState.NOT_LOADED
assert config_entry.state is ConfigEntryState.NOT_LOADED
async def test_from_import(hass: HomeAssistant) -> None:
@ -72,7 +72,7 @@ async def test_delayed_speedtest_during_startup(
await hass.async_block_till_done()
hass.set_state(original_state)
assert config_entry.state == config_entries.ConfigEntryState.LOADED
assert config_entry.state is ConfigEntryState.LOADED
state = hass.states.get("sensor.fast_com_download")
# Assert state is Unknown as fast.com isn't starting until HA has started
assert state.state is STATE_UNKNOWN
@ -87,7 +87,7 @@ async def test_delayed_speedtest_during_startup(
assert state is not None
assert state.state == "5.0"
assert config_entry.state == config_entries.ConfigEntryState.LOADED
assert config_entry.state is ConfigEntryState.LOADED
async def test_service_deprecated(