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 CSIP17 #125

Open dockmd opened 2 weeks ago

dockmd commented 2 weeks ago

Test case: https://github.com/DILCISBoard/eark-ip-test-corpus/tree/integration/corpus/CSIP/CSIP17/testCase.xml Package: https://github.com/DILCISBoard/eark-ip-test-corpus/tree/integration/corpus/CSIP/CSIP17/valid/IP_18006_CSIP17_1 Validation error: 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 90, in from_path mets: MetsFile = MetsFiles.from_file(mets_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\mets.py", line 96, in from_file errors: List[str] = _validate_file_entry(file_entry, element, os.path.dirname(mets_file)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\mets.py", line 212, in _validate_file_entry errors.append(_get_path_requirement_id(element)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\mets.py", line 295, in _get_path_requirement_id raise ValueError(f'Tag {tag} cannot be converted to a requirement ID.') ValueError: Tag file cannot be converted to a requirement ID.

Package: https://github.com/DILCISBoard/eark-ip-test-corpus/tree/integration/corpus/CSIP/CSIP17/valid/IP_18000_CSIP17_2 Validation error: 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 90, in from_path mets: MetsFile = MetsFiles.from_file(mets_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\mets.py", line 96, in from_file errors: List[str] = _validate_file_entry(file_entry, element, os.path.dirname(mets_file)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\mets.py", line 212, in _validate_file_entry errors.append(_get_path_requirement_id(element)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\mets.py", line 295, in _get_path_requirement_id raise ValueError(f'Tag {tag} cannot be converted to a requirement ID.') ValueError: Tag file cannot be converted to a requirement ID.

Package: https://github.com/DILCISBoard/eark-ip-test-corpus/tree/integration/corpus/CSIP/CSIP17/invalid/IP_18000_CSIP17_3 Validation error: 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 90, in from_path mets: MetsFile = MetsFiles.from_file(mets_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\mets.py", line 96, in from_file errors: List[str] = _validate_file_entry(file_entry, element, os.path.dirname(mets_file)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\mets.py", line 212, in _validate_file_entry errors.append(_get_path_requirement_id(element)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "PATH\eark-validator\eark_validator\mets.py", line 295, in _get_path_requirement_id raise ValueError(f'Tag {tag} cannot be converted to a requirement ID.') ValueError: Tag file cannot be converted to a requirement ID.