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

@ -11,7 +11,7 @@ from homeassistant.core import HomeAssistant
async def test_setup_entry(hass: HomeAssistant, setup_config_entry) -> None:
"""Test successful setup of entry."""
assert setup_config_entry.state == ConfigEntryState.LOADED
assert setup_config_entry.state is ConfigEntryState.LOADED
async def test_setup_entry_fails(hass: HomeAssistant, config_entry) -> None:
@ -24,15 +24,15 @@ async def test_setup_entry_fails(hass: HomeAssistant, config_entry) -> None:
assert not await hass.config_entries.async_setup(config_entry.entry_id)
assert config_entry.state == ConfigEntryState.SETUP_ERROR
assert config_entry.state is ConfigEntryState.SETUP_ERROR
async def test_unload_entry(hass: HomeAssistant, setup_config_entry) -> None:
"""Test successful unload of entry."""
assert setup_config_entry.state == ConfigEntryState.LOADED
assert setup_config_entry.state is ConfigEntryState.LOADED
assert await hass.config_entries.async_unload(setup_config_entry.entry_id)
assert setup_config_entry.state == ConfigEntryState.NOT_LOADED
assert setup_config_entry.state is ConfigEntryState.NOT_LOADED
@pytest.mark.parametrize("config_entry_version", [1])
@ -49,5 +49,5 @@ async def test_migrate_entry(hass: HomeAssistant, config_entry) -> None:
with patch("homeassistant.components.axis.async_setup_entry", return_value=True):
assert await hass.config_entries.async_setup(config_entry.entry_id)
assert config_entry.state == ConfigEntryState.LOADED
assert config_entry.state is ConfigEntryState.LOADED
assert config_entry.version == 3