E-ARK-Software / eark-validator

E-ARK Python Information Package validation library
Apache License 2.0
5 stars 3 forks source link

Incorrect validation of requirement CSIP117 #124

Open dockmd opened 3 weeks ago

dockmd commented 3 weeks ago

Validation of package: https://github.com/DILCISBoard/eark-ip-test-corpus/tree/integration/corpus/CSIP/CSIP117/testCase.xml fails: Traceback (most recent call last): File "PATH\eark-validator\eark_validator\infopacks\information_package.py", line 67, in details_from_mets_file oaispackagetype = element.find(QUAL_METSHDR).get(QUAL_OAISPACKAGETYPE, '') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'get'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "PATH\eark-validator.exe__main.py", line 7, in File "PATH\eark-validator\eark_validator\cli\app.py", line 127, in main _loopexit, = _validate_ip(file_arg, args.specification_version) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\cli\app.py", line 135, in _validate_ip report = PACKAGES.PackageValidator(checked_path, version).validation_report ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\packages.py", line 66, in init__ self._report = self.validate(self._version, self._to_proc) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\packages.py", line 102, in validate package: InformationPackage = InformationPackages.from_path(to_validate) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\infopacks\information_package.py", line 91, in from_path details: PackageDetails = InformationPackages.details_from_mets_file(mets_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\infopacks\information_package.py", line 71, in details_from_mets_file raise ValueError(NOT_VALID_FILE.format(mets_file, 'XML')) from ex ValueError: Path PATH-ip-test-corpus\corpus\CSIP\CSIP117\invalid\mets-xml_metsHdr_not_exist\METS.xml is not a vald XML file.