def _full_validation(name, to_validate):
    rules = SC.ValidationRules(name)
    rules.validate(str(files(XML).joinpath(to_validate)))
    for failure in rules.get_report().failures:
        print(failure)
    for warning in rules.get_report().warnings:
        print(warning)
    report = rules.get_report()
    return report.is_valid, rules.get_report().failures, rules.get_report().warnings
 def test_validate_mets_no_objid(self):
     rules = SC.ValidationRules('test',
                                str(files(SCHEMATRON).joinpath('METS-one-default-ns.xml')))
     rules.validate(str(files(XML).joinpath('METS-no-objid.xml')))
     self.assertFalse(rules.get_report().is_valid)
 def test_validate_invalid_person(self):
     rules = SC.ValidationRules('test', str(files(SCHEMATRON).joinpath('person.xml')))
     rules.validate(str(files(XML).joinpath('invalid-person.xml')))
     self.assertFalse(rules.get_report().is_valid)
 def test_load_schematron(self):
     rules = SC.ValidationRules('test', str(files(SCHEMATRON).joinpath('person.xml')))
     assert_count = 0
     for _ in rules.get_assertions():
         assert_count += 1
     self.assertTrue(assert_count > 0)