1
0
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:
Erik Montnemery
2024-06-14 08:00:36 +02:00
committed by GitHub
parent 9e146a51c2
commit 471e2a17a2
2 changed files with 22 additions and 18 deletions

View File

@@ -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