def test_create_pointer_file(self):
     """ It should be able to create a pointer file. """
     pointer_file = self.package.create_pointer_file(
         TEST_PREMIS_OBJECT, [TEST_PREMIS_EVENT],
         premis_agents=[TEST_PREMIS_AGENT_1, TEST_PREMIS_AGENT_2],
         validate=False)
     is_valid, report = metsrw.validate(pointer_file.serialize(),
                                        schematron=metsrw.AM_PNTR_SCT_PATH)
     assert is_valid
Exemple #2
0
 def test_full_pointer_file(self):
     """Test construction of a full METS pointer file. Assert that the
     resulting file is a valid METS file using the metsrw.validate function
     which validates both against the METS/PREMIS .xsd files and against an
     Archivematica-specific Schematron file.
     """
     mw = self.create_test_pointer_file()
     is_valid, report = metsrw.validate(mw.serialize(),
                                        schematron=metsrw.AM_PNTR_SCT_PATH)
     if not is_valid:
         print('Pointer file is NOT'
               ' valid.\n{}'.format(metsrw.report_string(report)))
     assert is_valid
Exemple #3
0
 def assert_mets_valid(self, mets_doc, schematron=metsrw.AM_SCT_PATH):
     is_valid, report = metsrw.validate(mets_doc, schematron=schematron)
     if not is_valid:
         raise AssertionError(report['report'])