'Test errors if component or platform not found.'

def test_component_platform_not_found(self):

    files = {'badcomponent.yaml': (BASE_CONFIG + 'beer:'), 'badplatform.yaml': (BASE_CONFIG + 'light:\n        platform:    beer')}
    with patch_yaml_files(files):
        res = check_config.check(get_test_config_dir('badcomponent.yaml'))
        change_yaml_files(res)
        self.assertDictEqual({}, res['components'])
        self.assertDictEqual({check_config.ERROR_STR: ['Component    not    found:    beer', 'Setup    failed    for    beer:    Component    not    found.']}, res['except'])
        self.assertDictEqual({}, res['secret_cache'])
        self.assertDictEqual({}, res['secrets'])
        self.assertListEqual(['.../badcomponent.yaml'], res['yaml_files'])
        res = check_config.check(get_test_config_dir('badplatform.yaml'))
        change_yaml_files(res)
        assert (res['components'] == {'light': [], 'group': None})
        assert (res['except'] == {check_config.ERROR_STR: ['Platform    not    found:    light.beer']})
        self.assertDictEqual({}, res['secret_cache'])
        self.assertDictEqual({}, res['secrets'])
        self.assertListEqual(['.../badplatform.yaml'], res['yaml_files'])
