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 #102 #103

Closed nutjob4life closed 3 years ago

nutjob4life commented 3 years ago

📜 Summary

This resolves #102 by adding a URL validator (a singleton utility) whose job is to check generated URLs for well-formedness and retrievability. It checks only the first such URL presented to it and fails (early) if it's not well-formed and the resource it describes cannot be resolved and exactly 1 byte of it successfully retrieved. (Normally we would do this with an HTTP HEAD request to save network usage but file: style URLs don't support HEAD.)

Merging this PR also adds:

🩺 Test Data and/or Report

fatalii 408 % date -u
Fri Mar 26 16:43:49 UTC 2021
fatalii 409 % bin/test
Running tests at level 1
Running zope.testrunner.layer.UnitTests tests:
  Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
  Running:
    15/20 (75.0%) test_logging_arguments (pds.aipgen.tests.test_utils.ArgumentTestCase)usage: 

  Ran 20 tests with 0 failures, 0 errors, 0 skipped in 0.773 seconds.
Tearing down left over layers:
  Tear down zope.testrunner.layer.UnitTests in 0.000 seconds.
fatalii 410 % echo \U+1F389
🎉
fatalii 411 % 

🧩 Related Issues

nutjob4life commented 3 years ago

FYI @jordanpadams https://foobar.com/ isn't a nonsensical URL! It's a real website that just happens to have an invalid SSL certificate 😝

In any case, try the latest commit on for size: 06f97ac0234c3e2c263bfee594c71c09f7f50fef