Remove logic converting empty or falsy YAML to empty dict (#103912)
* Correct logic converting empty YAML to empty dict * Modify according to github comments * Add load_yaml_dict helper * Update check_config script * Update tests
This commit is contained in:
parent
a8ca73a7dd
commit
5b55c7da5f
20 changed files with 112 additions and 47 deletions
|
@ -141,7 +141,7 @@ async def test_lovelace_from_yaml(
|
|||
events = async_capture_events(hass, const.EVENT_LOVELACE_UPDATED)
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.lovelace.dashboard.load_yaml",
|
||||
"homeassistant.components.lovelace.dashboard.load_yaml_dict",
|
||||
return_value={"hello": "yo"},
|
||||
):
|
||||
await client.send_json({"id": 7, "type": "lovelace/config"})
|
||||
|
@ -154,7 +154,7 @@ async def test_lovelace_from_yaml(
|
|||
|
||||
# Fake new data to see we fire event
|
||||
with patch(
|
||||
"homeassistant.components.lovelace.dashboard.load_yaml",
|
||||
"homeassistant.components.lovelace.dashboard.load_yaml_dict",
|
||||
return_value={"hello": "yo2"},
|
||||
):
|
||||
await client.send_json({"id": 8, "type": "lovelace/config", "force": True})
|
||||
|
@ -245,7 +245,7 @@ async def test_dashboard_from_yaml(
|
|||
events = async_capture_events(hass, const.EVENT_LOVELACE_UPDATED)
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.lovelace.dashboard.load_yaml",
|
||||
"homeassistant.components.lovelace.dashboard.load_yaml_dict",
|
||||
return_value={"hello": "yo"},
|
||||
):
|
||||
await client.send_json(
|
||||
|
@ -260,7 +260,7 @@ async def test_dashboard_from_yaml(
|
|||
|
||||
# Fake new data to see we fire event
|
||||
with patch(
|
||||
"homeassistant.components.lovelace.dashboard.load_yaml",
|
||||
"homeassistant.components.lovelace.dashboard.load_yaml_dict",
|
||||
return_value={"hello": "yo2"},
|
||||
):
|
||||
await client.send_json(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue