From 136ba3970b513ec203c733c5338f9dd38ad50b8e Mon Sep 17 00:00:00 2001 From: Uwe Hartwig Date: Mon, 10 Jun 2024 10:59:17 +0200 Subject: [PATCH] [app][feat] validate if configured close #19 --- cli_oai_client.py | 4 +- cli_oai_local.py | 4 +- lib/ocrd3_odem/ocrd3_odem.py | 23 +- lib/ocrd3_odem/processing_mets.py | 34 +- tests/resources/1981185920_37167_01.xml | 454 +++++++++++++++++++++++ tests/resources/1981185920_37167_02.xml | 456 ++++++++++++++++++++++++ tests/resources/1981185920_37167_03.xml | 448 +++++++++++++++++++++++ tests/test_odem_processing_mets.py | 81 +++++ 8 files changed, 1472 insertions(+), 32 deletions(-) create mode 100644 tests/resources/1981185920_37167_01.xml create mode 100644 tests/resources/1981185920_37167_02.xml create mode 100644 tests/resources/1981185920_37167_03.xml diff --git a/cli_oai_client.py b/cli_oai_client.py index 5ebf849..8b4e67f 100644 --- a/cli_oai_client.py +++ b/cli_oai_client.py @@ -353,7 +353,7 @@ def _clear_sub_dirs(root_dir: str): process_resource_monitor.check_vmem() process_resource_monitor.monit_disk_space(PROCESS.load) if CFG.getboolean('mets', 'prevalidate', fallback=True): - PROCESS.validate_mets() + PROCESS.validate_metadata() PROCESS.inspect_metadata() PROCESS.clear_existing_entries() PROCESS.language_modelconfig() @@ -372,7 +372,7 @@ def _clear_sub_dirs(root_dir: str): PROCESS.create_text_bundle_data() PROCESS.postprocess_mets() if CFG.getboolean('mets', 'postvalidate', fallback=True): - PROCESS.validate_mets() + PROCESS.validate_metadata() if not MUST_KEEP_RESOURCES: PROCESS.delete_before_export(LOCAL_DELETE_BEFORE_EXPORT) PROCESS.export_data() diff --git a/cli_oai_local.py b/cli_oai_local.py index 4f09f62..9d9c335 100644 --- a/cli_oai_local.py +++ b/cli_oai_local.py @@ -198,7 +198,7 @@ def wrap_save_record_state(status: str, urn, **kwargs): process_resource_monitor.check_vmem() process_resource_monitor.monit_disk_space(PROCESS.load) if CFG.getboolean('mets','prevalidate', fallback=True): - PROCESS.validate_mets() + PROCESS.validate_metadata() PROCESS.inspect_metadata() PROCESS.clear_existing_entries() PROCESS.language_modelconfig() @@ -214,7 +214,7 @@ def wrap_save_record_state(status: str, urn, **kwargs): PROCESS.create_text_bundle_data() PROCESS.postprocess_mets() if CFG.getboolean('mets','postvalidate', fallback=True): - PROCESS.validate_mets() + PROCESS.validate_metadata() if not MUST_KEEP_RESOURCES: PROCESS.delete_before_export(LOCAL_DELETE_BEVOR_EXPORT) PROCESS.export_data() diff --git a/lib/ocrd3_odem/ocrd3_odem.py b/lib/ocrd3_odem/ocrd3_odem.py index 2bee6a3..efbe200 100644 --- a/lib/ocrd3_odem/ocrd3_odem.py +++ b/lib/ocrd3_odem/ocrd3_odem.py @@ -49,10 +49,9 @@ CATALOG_ULB, ODEMMetadataInspecteur, ODEMMetadataMetsException, - # extract_mets_data, integrate_ocr_file, postprocess_mets, - validate_mets, + validate, ) from .processing_ocrd import ( run_ocr_page, @@ -480,14 +479,18 @@ def postprocess_mets(self): postprocess_mets(self.mets_file, self.cfg.get('ocr', 'ocrd_baseimage')) - def validate_mets(self): - """Forward METS-schema validation""" - try: - validate_mets(self.mets_file) - except dfv.InvalidXMLException as err: - if len(err.args) > 0 and ('SCHEMASV' in str(err.args[0])): - raise ODEMException(str(err.args[0])) from err - raise err + def validate_metadata(self): + """Forward (optional) validation concerning + METS/MODS XML-schema and/or current DDB-schematron + validation for 'digitalisierte medien' + """ + check_ddb = False + if self.cfg.has_option('mets', 'ddb_validation'): + check_ddb = self.cfg.getboolean('mets', 'ddb_validation', fallback=False) + dtype = 'Aa' + if 'pica' in self.record.info: + dtype = self.record.info['pica'] + return validate(self.mets_file, validate_ddb=check_ddb, digi_type=dtype) def export_data(self): """re-do metadata and transform into output format""" diff --git a/lib/ocrd3_odem/processing_mets.py b/lib/ocrd3_odem/processing_mets.py index 5e4e24f..512a8e4 100644 --- a/lib/ocrd3_odem/processing_mets.py +++ b/lib/ocrd3_odem/processing_mets.py @@ -1,10 +1,7 @@ """Encapsulate Implementations concerning METS/MODS handling""" import os - -from typing import ( - List, -) +import typing import lxml.etree as ET import digiflow as df @@ -13,6 +10,7 @@ from .odem_commons import ( FILEGROUP_IMG, FILEGROUP_OCR, + ODEMException, ) TYPE_PRINTS_PICA = ['a', 'f', 'F', 'Z', 'B'] @@ -29,16 +27,6 @@ IMAGE_GROUP_DEFAULT = 'DEFAULT' -# def extract_mets_data(the_self, the_data): -# """ -# Migration Post-recive OAI METS/MODS callback -# """ - -# xml_root = ET.fromstring(the_data) -# mets_tree = df.post_oai_extract_metsdata(xml_root) -# df.write_xml_file(mets_tree, the_self.path_mets) - - class ODEMMetadataMetsException(Exception): """Mark state when inconsistencies exist between linkings of physical and logical @@ -261,7 +249,7 @@ def clear_filegroups(xml_file, removals): proc.write() -def integrate_ocr_file(xml_tree, ocr_files: List) -> int: +def integrate_ocr_file(xml_tree, ocr_files: typing.List) -> int: """Enrich given OCR-Files into XML tree Returns number of linked files @@ -319,7 +307,7 @@ def _link_fulltext(file_ident, xml_tree): return 0 -def is_in(tokens: List[str], label): +def is_in(tokens: typing.List[str], label): """label contained somewhere in a list of tokens?""" return any(t in label for t in tokens) @@ -370,8 +358,18 @@ def _clear_provenance_links(mproc): parent.remove(old_dv) -def validate_mets(mets_file:str): +def validate(mets_file:str, validate_ddb=False, digi_type='Aa'): """Forward METS-schema validation""" xml_root = ET.parse(mets_file).getroot() - dfv.validate_xml(xml_root) + try: + dfv.validate_xml(xml_root) + if validate_ddb: + df.ddb_validation(path_mets=mets_file, digi_type=digi_type) + except dfv.InvalidXMLException as err: + if len(err.args) > 0 and ('SCHEMASV' in str(err.args[0])): + raise ODEMException(str(err.args[0])) from err + raise err + except df.DigiflowDDBException as ddb_err: + raise ODEMException(ddb_err.args[0]) from ddb_err + return True diff --git a/tests/resources/1981185920_37167_01.xml b/tests/resources/1981185920_37167_01.xml new file mode 100644 index 0000000..81c9122 --- /dev/null +++ b/tests/resources/1981185920_37167_01.xml @@ -0,0 +1,454 @@ + + + + Kitodo - kitodo-ugh-2.1.4-SNAPSHOT-v1.11.1-108-g2b516b3 - 03−January−2021 + Kitodo + + + zedExporter + PDF-Dokument-Downloadlink wurde eingefügt. + + + + + + + + urn:nbn:de:gbv:3:1-1192015415-165709200-14 + 10337601 + |fei|s.es r-i- i-ra a-am C 1746R|HAAB Weimar; ULB Sachsen-Anhalt Halle + + 165709200 + 25-10-94 + 06-05-21 + + + Docendi Ratio In Schola Isenacensi Ante Nostra Tempora Vsvrpata Hodieqve Probata Svb Avspicia Anniversariae Lvstrationis A Die XXVIII. Mart. Ad Diem I. Apr. A. M DCC XXXXVI. Peragendae Qvam Vt Ill. Gymnasii Patroni Mvsarvmq. Favtores Concelebrare Itemq. Qvatvor Orationes Die III. April. Recitandas Benigne Avdire Dignentvr Svmmisse Et Observantiss. Rogantvr Exposita A Io. Michaele Hevsingero Ill. Gymn. Direct. + + + Docendi ratio in schola Isenacensi ante nostra tempora usurpata hodieque probata sub auspicia anniversariae lustrationis a die XXVIII. Mart. ad diem I. Apr. A. MDCCXXXXV. Peragendae Quam Vt Ill. Gymnasii Patroni Musarumq. Fautores Concelebrare Itemq. Quatuor Orationes Die III. April. Recitandas Benigne Audire Dignentur Summisse Et Observantiss. Rogantur Exposita A Io. Michaele Heusingero Ill. Gymn. Direct. + + + 243310722 + + + 1746] + + + + Eisenach, Gymnasium, Schulprogramm, 1746 + Signaturformel: )(4, )()(4 + Die Datierung am Textende lautet: "P.P. Isenaci D. XXVII. Martii A. MDCCXXXXVI." + + Johann Michael + Heusinger + + aut + + Heusinger, Johann Michael + 1690-1751 + + + Johann Christoph + Krug + + prt + + Krug, Johann Christoph + + + Gymnasium illustre Isenacense + + oth + + + + Typis Johann Christoph Krug + + prt + + + + lat + + Vorlageform der Veröffentlichungsangabe: Isenaci Formis Krvgianis. Y - Erscheinungsdatum nach Datierung am Textende bestimmt + + 1746 + + Isenaci + + Formis Krvgianis + + Eisenach + + + + 16 ungezählte Seiten; 4° + + Schulprogramm + Gelegenheitsschrift:Einladung + + + 1746 + + Aa + + Text + txt + + + + Universitäts- und Landesbibliothek Sachsen-Anhalt + + Halle (Saale) + + [Electronic ed.] + 2021 + + + Universitäts- und Landesbibliothek Sachsen-Anhalt + Pon Ya 4371, QK + + 090 + Public Domain Mark 1.0 + doi:10.25673/36934 + + + + + + + + + + Pon Ya 4371, QK + + + + + + + + + + + Universitäts- und Landesbibliothek Sachsen-Anhalt + https://opendata.uni-halle.de/image/mets_viewerLogo.gif + http://www.bibliothek.uni-halle.de + mailto:auskunft@bibliothek.uni-halle.de + https://creativecommons.org/publicdomain/mark/1.0/ + + + + + + + + + http://opac.bibliothek.uni-halle.de/DB=1/CLK?IKT=12&TRM=165709200 + https://opendata.uni-halle.de//handle/1981185920/37167 + https://opendata.uni-halle.de//json/iiif/1981185920/37167/3880af6a-c1c5-4304-af52-9f131b83df3a/manifest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/resources/1981185920_37167_02.xml b/tests/resources/1981185920_37167_02.xml new file mode 100644 index 0000000..6a42dd7 --- /dev/null +++ b/tests/resources/1981185920_37167_02.xml @@ -0,0 +1,456 @@ + + + + Kitodo - kitodo-ugh-2.1.4-SNAPSHOT-v1.11.1-108-g2b516b3 - 03−January−2021 + Kitodo + + + zedExporter + PDF-Dokument-Downloadlink wurde eingefügt. + + + + + + + + urn:nbn:de:gbv:3:1-1192015415-165709200-14 + 10337601 + |fei|s.es r-i- i-ra a-am C 1746R|HAAB Weimar; ULB Sachsen-Anhalt Halle + + 165709200 + 25-10-94 + 06-05-21 + + + Docendi Ratio In Schola Isenacensi Ante Nostra Tempora Vsvrpata Hodieqve Probata Svb Avspicia Anniversariae Lvstrationis A Die XXVIII. Mart. Ad Diem I. Apr. A. M DCC XXXXVI. Peragendae Qvam Vt Ill. Gymnasii Patroni Mvsarvmq. Favtores Concelebrare Itemq. Qvatvor Orationes Die III. April. Recitandas Benigne Avdire Dignentvr Svmmisse Et Observantiss. Rogantvr Exposita A Io. Michaele Hevsingero Ill. Gymn. Direct. + + + Docendi ratio in schola Isenacensi ante nostra tempora usurpata hodieque probata sub auspicia anniversariae lustrationis a die XXVIII. Mart. ad diem I. Apr. A. MDCCXXXXV. Peragendae Quam Vt Ill. Gymnasii Patroni Musarumq. Fautores Concelebrare Itemq. Quatuor Orationes Die III. April. Recitandas Benigne Audire Dignentur Summisse Et Observantiss. Rogantur Exposita A Io. Michaele Heusingero Ill. Gymn. Direct. + + + + 243310722 + + + + 1746] + + + + Eisenach, Gymnasium, Schulprogramm, 1746 + Signaturformel: )(4, )()(4 + Die Datierung am Textende lautet: "P.P. Isenaci D. XXVII. Martii A. MDCCXXXXVI." + + Johann Michael + Heusinger + + aut + + Heusinger, Johann Michael + 1690-1751 + + + Johann Christoph + Krug + + prt + + Krug, Johann Christoph + + + Gymnasium illustre Isenacense + + oth + + + + Typis Johann Christoph Krug + + prt + + + + lat + + Vorlageform der Veröffentlichungsangabe: Isenaci Formis Krvgianis. Y - Erscheinungsdatum nach Datierung am Textende bestimmt + + 1746 + + Isenaci + + Formis Krvgianis + + Eisenach + + + + 16 ungezählte Seiten; 4° + + Schulprogramm + Gelegenheitsschrift:Einladung + + + 1746 + + Aa + + Text + txt + + + + Universitäts- und Landesbibliothek Sachsen-Anhalt + + Halle (Saale) + + [Electronic ed.] + 2021 + + + Universitäts- und Landesbibliothek Sachsen-Anhalt + Pon Ya 4371, QK + + 090 + Public Domain Mark 1.0 + doi:10.25673/36934 + + + + + + + + + + Pon Ya 4371, QK + + + + + + + + + + + Universitäts- und Landesbibliothek Sachsen-Anhalt + https://opendata.uni-halle.de/image/mets_viewerLogo.gif + http://www.bibliothek.uni-halle.de + mailto:auskunft@bibliothek.uni-halle.de + https://creativecommons.org/publicdomain/mark/1.0/ + + + + + + + + + http://opac.bibliothek.uni-halle.de/DB=1/CLK?IKT=12&TRM=165709200 + https://opendata.uni-halle.de//handle/1981185920/37167 + https://opendata.uni-halle.de//json/iiif/1981185920/37167/3880af6a-c1c5-4304-af52-9f131b83df3a/manifest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/resources/1981185920_37167_03.xml b/tests/resources/1981185920_37167_03.xml new file mode 100644 index 0000000..d32b9b6 --- /dev/null +++ b/tests/resources/1981185920_37167_03.xml @@ -0,0 +1,448 @@ + + + + Kitodo - kitodo-ugh-2.1.4-SNAPSHOT-v1.11.1-108-g2b516b3 - 03−January−2021 + Kitodo + + + zedExporter + PDF-Dokument-Downloadlink wurde eingefügt. + + + + + + + + urn:nbn:de:gbv:3:1-1192015415-165709200-14 + 10337601 + |fei|s.es r-i- i-ra a-am C 1746R|HAAB Weimar; ULB Sachsen-Anhalt Halle + + 165709200 + 25-10-94 + 06-05-21 + + + Docendi Ratio In Schola Isenacensi Ante Nostra Tempora Vsvrpata Hodieqve Probata Svb Avspicia Anniversariae Lvstrationis A Die XXVIII. Mart. Ad Diem I. Apr. A. M DCC XXXXVI. Peragendae Qvam Vt Ill. Gymnasii Patroni Mvsarvmq. Favtores Concelebrare Itemq. Qvatvor Orationes Die III. April. Recitandas Benigne Avdire Dignentvr Svmmisse Et Observantiss. Rogantvr Exposita A Io. Michaele Hevsingero Ill. Gymn. Direct. + + + Docendi ratio in schola Isenacensi ante nostra tempora usurpata hodieque probata sub auspicia anniversariae lustrationis a die XXVIII. Mart. ad diem I. Apr. A. MDCCXXXXV. Peragendae Quam Vt Ill. Gymnasii Patroni Musarumq. Fautores Concelebrare Itemq. Quatuor Orationes Die III. April. Recitandas Benigne Audire Dignentur Summisse Et Observantiss. Rogantur Exposita A Io. Michaele Heusingero Ill. Gymn. Direct. + + + + Foo-Bar + + + 243310722 + + + + 1746] + + + + Eisenach, Gymnasium, Schulprogramm, 1746 + Signaturformel: )(4, )()(4 + Die Datierung am Textende lautet: "P.P. Isenaci D. XXVII. Martii A. MDCCXXXXVI." + + Johann Michael + Heusinger + + aut + + Heusinger, Johann Michael + 1690-1751 + + + Johann Christoph + Krug + + prt + + Krug, Johann Christoph + + + Gymnasium illustre Isenacense + + oth + + + + Typis Johann Christoph Krug + + prt + + + + lat + + Vorlageform der Veröffentlichungsangabe: Isenaci Formis Krvgianis. Y - Erscheinungsdatum nach Datierung am Textende bestimmt + + 1746 + + Isenaci + + Formis Krvgianis + + Eisenach + + + + 16 ungezählte Seiten; 4° + + Schulprogramm + Gelegenheitsschrift:Einladung + + + 1746 + + Aa + + Text + txt + + + + Universitäts- und Landesbibliothek Sachsen-Anhalt + + Halle (Saale) + + [Electronic ed.] + 2021 + + + Universitäts- und Landesbibliothek Sachsen-Anhalt + Pon Ya 4371, QK + + 090 + Public Domain Mark 1.0 + doi:10.25673/36934 + + + + + + + + + + Universitäts- und Landesbibliothek Sachsen-Anhalt + https://opendata.uni-halle.de/image/mets_viewerLogo.gif + http://www.bibliothek.uni-halle.de + mailto:auskunft@bibliothek.uni-halle.de + https://creativecommons.org/publicdomain/mark/1.0/ + + + + + + + + + http://opac.bibliothek.uni-halle.de/DB=1/CLK?IKT=12&TRM=165709200 + https://opendata.uni-halle.de//handle/1981185920/37167 + https://opendata.uni-halle.de//json/iiif/1981185920/37167/3880af6a-c1c5-4304-af52-9f131b83df3a/manifest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/test_odem_processing_mets.py b/tests/test_odem_processing_mets.py index 48ac650..e573816 100644 --- a/tests/test_odem_processing_mets.py +++ b/tests/test_odem_processing_mets.py @@ -9,6 +9,8 @@ import lxml.etree as ET import digiflow as df +import lib.ocrd3_odem as o3o + from lib.ocrd3_odem import ( ODEMMetadataMetsException, ODEMNoImagesForOCRException, @@ -273,3 +275,82 @@ def test_mets_mods_sbb_vol01_filtering_custom(): _image_page_pairs = inspc.image_pairs assert not any('PHYS_0001' in p[1] for p in _image_page_pairs) assert len(_image_page_pairs) == 129 + + +def test_validate_mets_105054_schema_fails(tmp_path): + """ + If Schema validation is required, then throw according exception + in this case: alert invalid order data format + """ + _record = df.OAIRecord('oai:opendata.uni-halle.de:1981185920/105054') + _work_dir = tmp_path / '1981185920_105054' + _work_dir.mkdir() + _orig_mets = TEST_RES / '1981185920_105054.xml' + shutil.copyfile(_orig_mets, _work_dir / '1981185920_105054.xml') + odem_processor = o3o.ODEMProcess(_record, work_dir=_work_dir) + odem_processor.cfg = fixture_configuration() + with pytest.raises(o3o.ODEMException) as exec: + odem_processor.validate_metadata() + + assert "'order': '1.1979' is not a valid value of the atomic type 'xs:integer'" in exec.value.args[0] + + +def test_validate_mets_37167_schema_fails(tmp_path): + """ + if is invalid mets file, throw according exception + """ + rec = df.OAIRecord('oai:opendata.uni-halle.de:1981185920/37167') + work_dir = tmp_path / '1981185920_37167' + work_dir.mkdir() + original_mets = TEST_RES / '1981185920_37167_01.xml' + shutil.copyfile(original_mets, work_dir / '1981185920_37167.xml') + odem_processor = o3o.ODEMProcess(rec, work_dir=work_dir) + odem_processor.cfg = fixture_configuration() + with pytest.raises(o3o.ODEMException) as exec: + odem_processor.validate_metadata() + + assert "recordIdentifier': This element is not expected" in exec.value.args[0] + + +def test_validate_mets_37167_ddb_fails(tmp_path): + """ + This time METS/MODS is valid but DDB validation is + requested which fails of 2024-06-10 with 3 errors: + * relatedItem missing type attribute + * extra mets:dmdSec not linked to LOGICAL MAP with + only shelfLocator (this we had already at Rahbar?) + """ + rec = df.OAIRecord('oai:opendata.uni-halle.de:1981185920/37167') + work_dir = tmp_path / '1981185920_37167' + work_dir.mkdir() + original_mets = TEST_RES / '1981185920_37167_02.xml' + shutil.copyfile(original_mets, work_dir / '1981185920_37167.xml') + odem_processor = o3o.ODEMProcess(rec, work_dir=work_dir) + odem_processor.cfg = fixture_configuration() + odem_processor.cfg.set('mets', 'ddb_validation', 'True') + with pytest.raises(o3o.ODEMException) as exec: + odem_processor.validate_metadata() + + ddb_complains = exec.value.args[0] + assert len(ddb_complains) == 3 + assert '[relatedItem_04] dmd_id:DMDLOG_0000' in ddb_complains[0] + assert '[location_01] dmd_id:DMDPHYS_0000 test:Pon Ya 4371, QK' in ddb_complains[1] + assert '[dmdSec_04] id:DMDPHYS_0000 test:Pon Ya 4371, QK' in ddb_complains[2] + + +def test_validate_mets_37167_finally_succeeds(tmp_path): + """ + This time METS/MODS and also DDB-validation are both pleased, + therefore a plain 'True' shall be returned + """ + + rec = df.OAIRecord('oai:opendata.uni-halle.de:1981185920/37167') + work_dir = tmp_path / '1981185920_37167' + work_dir.mkdir() + original_mets = TEST_RES / '1981185920_37167_03.xml' + shutil.copyfile(original_mets, work_dir / '1981185920_37167.xml') + odem_processor = o3o.ODEMProcess(rec, work_dir=work_dir) + odem_processor.cfg = fixture_configuration() + odem_processor.cfg.set('mets', 'ddb_validation', 'True') + + assert odem_processor.validate_metadata()