check_config: Add support for packages (#5574)

This commit is contained in:
Johann Kellerman 2017-01-27 07:42:14 +02:00 committed by Paulus Schoutsen
parent a465a45588
commit 3f2fdb97a0
2 changed files with 45 additions and 14 deletions

View file

@ -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'] == {}