mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
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:
@@ -13,9 +13,9 @@ from tests.common import MockConfigEntry
|
||||
@pytest.mark.parametrize(
|
||||
"first_con, second_con,exp_type, exp_result, exp_reason",
|
||||
[
|
||||
(True, True, "create_entry", "loaded", ""),
|
||||
(False, False, "abort", "", "no_connection"),
|
||||
(True, False, "create_entry", "setup_retry", ""),
|
||||
(True, True, "create_entry", config_entries.ConfigEntryState.LOADED, ""),
|
||||
(False, False, "abort", None, "no_connection"),
|
||||
(True, False, "create_entry", config_entries.ConfigEntryState.SETUP_RETRY, ""),
|
||||
],
|
||||
)
|
||||
async def test_flow(hass, first_con, second_con, exp_type, exp_result, exp_reason):
|
||||
@@ -104,4 +104,4 @@ async def test_two_entries(hass):
|
||||
data={dynalite.CONF_HOST: host2},
|
||||
)
|
||||
assert result["type"] == "create_entry"
|
||||
assert result["result"].state == "loaded"
|
||||
assert result["result"].state == config_entries.ConfigEntryState.LOADED
|
||||
|
||||
Reference in New Issue
Block a user