def test_islandora_no_id(self): """It should return an empty list.""" path = os.path.join( FIXTURES_DIR, 'test-identifiers-MODS-METS.xml') # Any XML with no OBJID assert identifier_functions.extract_identifier_from_islandora( path) == []
def get_identifiers(job, sip_path): """Get additional identifiers to index.""" identifiers = [] # MODS mods_paths = glob( "{}/submissionDocumentation/**/mods/*.xml".format(sip_path)) for mods in mods_paths: identifiers.extend( identifier_functions.extract_identifiers_from_mods(mods)) # Islandora identifier islandora_path = glob( "{}/submissionDocumentation/**/*-METS.xml".format(sip_path)) for mets in islandora_path: identifiers.extend( identifier_functions.extract_identifier_from_islandora(mets)) job.pyprint("Indexing additional identifiers %s", identifiers) return identifiers
def test_islandora(self): """It should return the object ID.""" path = os.path.join(FIXTURES_DIR, 'test-identifiers-islandora-METS.xml') assert identifier_functions.extract_identifier_from_islandora( path) == ['yamani:12']