Use is in ConfigEntryState enum comparison in tests (A-M) (#114925)
This commit is contained in:
parent
dd8de14cc5
commit
0b01326f9f
99 changed files with 302 additions and 295 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue