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
|
@ -288,14 +288,14 @@ async def test_setup_and_retry_adapter_not_yet_available(
|
|||
|
||||
assert "Failed to start Bluetooth" in caplog.text
|
||||
assert len(bluetooth.async_discovered_service_info(hass)) == 0
|
||||
assert entry.state == ConfigEntryState.SETUP_RETRY
|
||||
assert entry.state is ConfigEntryState.SETUP_RETRY
|
||||
|
||||
with patch(
|
||||
"habluetooth.scanner.OriginalBleakScanner.start",
|
||||
):
|
||||
async_fire_time_changed(hass, dt_util.utcnow() + timedelta(minutes=10))
|
||||
await hass.async_block_till_done()
|
||||
assert entry.state == ConfigEntryState.LOADED
|
||||
assert entry.state is ConfigEntryState.LOADED
|
||||
|
||||
with patch(
|
||||
"habluetooth.scanner.OriginalBleakScanner.stop",
|
||||
|
@ -327,7 +327,7 @@ async def test_no_race_during_manual_reload_in_retry_state(
|
|||
|
||||
assert "Failed to start Bluetooth" in caplog.text
|
||||
assert len(bluetooth.async_discovered_service_info(hass)) == 0
|
||||
assert entry.state == ConfigEntryState.SETUP_RETRY
|
||||
assert entry.state is ConfigEntryState.SETUP_RETRY
|
||||
|
||||
with patch(
|
||||
"habluetooth.scanner.OriginalBleakScanner.start",
|
||||
|
@ -335,7 +335,7 @@ async def test_no_race_during_manual_reload_in_retry_state(
|
|||
await hass.config_entries.async_reload(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert entry.state == ConfigEntryState.LOADED
|
||||
assert entry.state is ConfigEntryState.LOADED
|
||||
|
||||
with patch(
|
||||
"habluetooth.scanner.OriginalBleakScanner.stop",
|
||||
|
@ -2866,7 +2866,7 @@ async def test_three_adapters_one_missing(
|
|||
entry.add_to_hass(hass)
|
||||
assert not await hass.config_entries.async_setup(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
assert entry.state == ConfigEntryState.SETUP_RETRY
|
||||
assert entry.state is ConfigEntryState.SETUP_RETRY
|
||||
|
||||
|
||||
async def test_auto_detect_bluetooth_adapters_linux(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue