'Tests whether a check definition has a valid configuration.'

def assertValidCheckFile(self, path):

    prefix = os.path.commonprefix(config.CONFIG['Checks.config_dir'])
    relpath = os.path.relpath(path, prefix)
    try:
        configs = checks.LoadConfigsFromFile(path)
    except yaml.error.YAMLError as e:
        self.fail(('File    %s    could    not    be    parsed:    %s\n' % (relpath, e)))
    errors = collections.OrderedDict()
    for (check_id, check_spec) in configs.iteritems():
        check_errors = self.GetCheckErrors(check_spec)
        if check_errors:
            msg = errors.setdefault(relpath, [('check_id:    %s' % check_id)])
            msg.append(check_errors)
    if errors:
        message = ''
        for (k, v) in errors.iteritems():
            message += ('File    %s    errors:\n' % k)
            message += ('        %s\n' % v[0])
            for err in v[1]:
                message += ('                %s\n' % err)
        self.fail(message)
