mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Improve error messages when config entry is in wrong state (#119591)
* Improve error messages when config entry is in wrong state * Apply suggestions from code review Co-authored-by: Joakim Sørensen <ludeeus@ludeeus.dev> * Adjust tests --------- Co-authored-by: Joakim Sørensen <ludeeus@ludeeus.dev>
This commit is contained in:
@@ -5606,9 +5606,10 @@ async def test_config_entry_unloaded_during_platform_setups(
|
||||
del task
|
||||
|
||||
assert (
|
||||
"OperationNotAllowed: The config entry Mock Title (test) with "
|
||||
"entry_id test2 cannot forward setup for ['light'] because it is "
|
||||
"not loaded in the ConfigEntryState.NOT_LOADED state"
|
||||
"OperationNotAllowed: The config entry 'Mock Title' (test) with "
|
||||
"entry_id 'test2' cannot forward setup for ['light'] because it is "
|
||||
"in state ConfigEntryState.NOT_LOADED, but needs to be in the "
|
||||
"ConfigEntryState.LOADED state"
|
||||
) in caplog.text
|
||||
|
||||
|
||||
@@ -5824,9 +5825,10 @@ async def test_config_entry_unloaded_during_platform_setup(
|
||||
del task
|
||||
|
||||
assert (
|
||||
"OperationNotAllowed: The config entry Mock Title (test) with "
|
||||
"entry_id test2 cannot forward setup for light because it is "
|
||||
"not loaded in the ConfigEntryState.NOT_LOADED state"
|
||||
"OperationNotAllowed: The config entry 'Mock Title' (test) with "
|
||||
"entry_id 'test2' cannot forward setup for light because it is "
|
||||
"in state ConfigEntryState.NOT_LOADED, but needs to be in the "
|
||||
"ConfigEntryState.LOADED state"
|
||||
) in caplog.text
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user