check_config: Add support for packages (#5574)

This commit is contained in:
Johann Kellerman authored and Paulus Schoutsen committed 2017-01-26 21:42:14 -08:00
1 parent a465a45588
commit 3f2fdb97a0
2 files changed
+45 -14

No files matched your search

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