1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

[packages] Allow list instead of dict for packages (#8688)

This commit is contained in:
Clyde Stubbs
2025-05-05 10:26:59 +10:00
committed by GitHub
parent 3ed03edfec
commit a31d8ec309
5 changed files with 63 additions and 33 deletions

View File

@@ -76,10 +76,11 @@ def test_package_unused(basic_esphome, basic_wifi):
def test_package_invalid_dict(basic_esphome, basic_wifi):
"""
Ensures an error is raised if packages is not valid.
If a url: key is present, it's expected to be well-formed remote package spec. Ensure an error is raised if not.
Any other simple dict passed as a package will be merged as usual but may fail later validation.
"""
config = {CONF_ESPHOME: basic_esphome, CONF_PACKAGES: basic_wifi}
config = {CONF_ESPHOME: basic_esphome, CONF_PACKAGES: basic_wifi | {CONF_URL: ""}}
with pytest.raises(cv.Invalid):
do_packages_pass(config)