mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Use is in ConfigEntryState enum comparison in tests (A-M) (#114925)
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user