NASA-PDS / deep-archive

PDS Open Archival Information System (OAIS) utilities, including Submission Information Package (SIP) and Archive Information Package (AIP) generators
https://nasa-pds.github.io/deep-archive/
Other
7 stars 4 forks source link

Resolve #87: log but don't otherwise try to parse bad XML #88

Closed nutjob4life closed 3 years ago

nutjob4life commented 3 years ago

📜 Summary

Merge this (if you dare) and instead of bombing out on parsing empty XML files (or any bad XML file) we instead just log a warning message and press on. This should work around Gary's empty ._bundle.xml files in #87.

🩺 Test Data and/or Report

In this merge we add a file called empty.xml so the unit and functional testing can ensure we work with empty XML files. Test report:

$ bin/test
Running tests at level 1
Running zope.testrunner.layer.UnitTests tests:
  Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
  Running:
    10/13 (76.9%) test_logging_arguments (pds.aipgen.tests.test_utils.ArgumentTestCase)usage: 

  Ran 13 tests with 0 failures, 0 errors, 0 skipped in 0.653 seconds.
Tearing down left over layers:
  Tear down zope.testrunner.layer.UnitTests in 0.000 seconds.

👨‍👩‍👦 Related Issues