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

View File

@@ -370,7 +370,7 @@ async def test_handle_events_late_setup(
await hass.config_entries.async_unload(helper.config_entry.entry_id)
await hass.async_block_till_done()
assert helper.config_entry.state == ConfigEntryState.NOT_LOADED
assert helper.config_entry.state is ConfigEntryState.NOT_LOADED
assert await async_setup_component(
hass,
@@ -424,7 +424,7 @@ async def test_handle_events_late_setup(
await hass.config_entries.async_setup(helper.config_entry.entry_id)
await hass.async_block_till_done()
assert helper.config_entry.state == ConfigEntryState.LOADED
assert helper.config_entry.state is ConfigEntryState.LOADED
# Make sure first automation (only) fires for single press
helper.pairing.testing.update_named_service(

View File

@@ -155,13 +155,13 @@ async def test_offline_device_raises(hass: HomeAssistant, controller) -> None:
)
await hass.async_block_till_done()
assert config_entry.state == ConfigEntryState.SETUP_RETRY
assert config_entry.state is ConfigEntryState.SETUP_RETRY
is_connected = True
async_fire_time_changed(hass, utcnow() + timedelta(seconds=10))
await hass.async_block_till_done()
assert config_entry.state == ConfigEntryState.LOADED
assert config_entry.state is ConfigEntryState.LOADED
assert hass.states.get("light.testdevice").state == STATE_OFF
@@ -212,13 +212,13 @@ async def test_ble_device_only_checks_is_available(
)
await hass.async_block_till_done()
assert config_entry.state == ConfigEntryState.SETUP_RETRY
assert config_entry.state is ConfigEntryState.SETUP_RETRY
is_available = True
async_fire_time_changed(hass, utcnow() + timedelta(seconds=10))
await hass.async_block_till_done()
assert config_entry.state == ConfigEntryState.LOADED
assert config_entry.state is ConfigEntryState.LOADED
assert hass.states.get("light.testdevice").state == STATE_OFF
is_available = False