def validate_rule_schema(source_file): valid = True for doc in parser.parse_yaml_file(source_file): schema = get_schema(source_file, doc, schema_type="rules") if not validate_schema(source_file, doc, schema): valid = False return valid
def test_parse_yaml_file(self): yml_docs = parser.parse_yaml_file(self.valid_rule_file) self.assertIsInstance(yml_docs, list) self.assertEqual(len(yml_docs), 1) for yml_doc in yml_docs: self.assertIsInstance(yml_doc, dict)