Change config entry state to an enum (#49654)
* Change config entry state to an enum * Allow but deprecate EntryState str equality comparison * Test fixes * Rename to ConfigEntryState * Remove str comparability backcompat * Update new occurrences of strs cropped up during review
This commit is contained in:
parent
0e7409e617
commit
19d25cd901
101 changed files with 557 additions and 688 deletions
|
@ -38,7 +38,7 @@ async def test_successful_config_entry(hass):
|
|||
) as forward_entry_setup:
|
||||
await hass.config_entries.async_setup(entry.entry_id)
|
||||
|
||||
assert entry.state == config_entries.ENTRY_STATE_LOADED
|
||||
assert entry.state is config_entries.ConfigEntryState.LOADED
|
||||
assert forward_entry_setup.mock_calls[0][1] == (
|
||||
entry,
|
||||
"sensor",
|
||||
|
@ -58,7 +58,7 @@ async def test_setup_failed(hass):
|
|||
|
||||
await hass.config_entries.async_setup(entry.entry_id)
|
||||
|
||||
assert entry.state == config_entries.ENTRY_STATE_SETUP_RETRY
|
||||
assert entry.state is config_entries.ConfigEntryState.SETUP_RETRY
|
||||
|
||||
|
||||
async def test_unload_entry(hass):
|
||||
|
@ -75,5 +75,5 @@ async def test_unload_entry(hass):
|
|||
assert await hass.config_entries.async_unload(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert entry.state == config_entries.ENTRY_STATE_NOT_LOADED
|
||||
assert entry.state is config_entries.ConfigEntryState.NOT_LOADED
|
||||
assert speedtestdotnet.DOMAIN not in hass.data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue