Closed nkrabben closed 7 years ago
Coverage decrease is from "file does not exist" exception no longer being triggered during hashing, since validation stops after the bag is found to be incomplete.
I removed the file existence check in _calculate_file_hashes()
since an incomplete bag would raise an error before _validate_entries()
is called.
This PR addresses https://github.com/LibraryOfCongress/bagit-python/issues/87
It separates the logic for completeness checking and hash validation into separate methods, and adds a CLI argument for checking completeness.
The changes have a larger change on validation behavior. If a bag is incomplete, hashes will not be calculated. This fits with my workflow when I need to fix bags or request retransfers, but I thought the change should be highlighted.
It also introduces some awkwardness in cli arguments.
--fast
does not include completeness checking. In the future it might be better to have the following arguments:--validate --oxum
= oxum check--validate --completeness
= completeness check--validate --fast
= completeness and oxum check--validate
= completeness, oxum, and hash check But I didn't want to change existing behaviors with this PR