check_config: Add support for packages (#5574)
This commit is contained in:
parent
a465a45588
commit
3f2fdb97a0
2 changed files with 45 additions and 14 deletions
|
@ -180,3 +180,24 @@ class TestCheckConfig(unittest.TestCase):
|
|||
'secrets': {'http_pw': 'abc123'},
|
||||
'yaml_files': ['.../secret.yaml', '.../secrets.yaml']
|
||||
}, res)
|
||||
|
||||
def test_package_invalid(self): \
|
||||
# pylint: disable=no-self-use,invalid-name
|
||||
"""Test a valid platform setup."""
|
||||
files = {
|
||||
'bad.yaml': BASE_CONFIG + (' packages:\n'
|
||||
' p1:\n'
|
||||
' group: ["a"]'),
|
||||
}
|
||||
with patch_yaml_files(files):
|
||||
res = check_config.check(get_test_config_dir('bad.yaml'))
|
||||
change_yaml_files(res)
|
||||
|
||||
err = res['except'].pop('homeassistant.packages.p1')
|
||||
assert res['except'] == {}
|
||||
assert err == {'group': ['a']}
|
||||
assert res['yaml_files'] == ['.../bad.yaml']
|
||||
|
||||
assert res['components'] == {}
|
||||
assert res['secret_cache'] == {}
|
||||
assert res['secrets'] == {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue