dandi / dandi-schema

Schemata for DANDI archive project
Apache License 2.0
7 stars 10 forks source link

get_checksum(): Error on empty input #113

Closed jwodder closed 2 years ago

jwodder commented 2 years ago

As we seem to be developing a consensus that empty directories are not allowed in Zarrs and should be excluded from checksum calculation, this PR makes get_checksum() raise a ValueError when both files and directories are empty. (I was initially going to add the exception to aggregate_checksum(), but that messed with EMPTY_CHECKSUM, and I'm not sure what should happen to that, so I left it alone for now.)

codecov[bot] commented 2 years ago

Codecov Report

Merging #113 (12343cf) into master (0099e5f) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #113      +/-   ##
==========================================
+ Coverage   96.61%   96.62%   +0.01%     
==========================================
  Files          18       18              
  Lines        1564     1569       +5     
==========================================
+ Hits         1511     1516       +5     
  Misses         53       53              
Flag Coverage Δ
unittests 96.62% <100.00%> (+0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dandischema/digests/tests/test_zarr.py 100.00% <100.00%> (ø)
dandischema/digests/zarr.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0099e5f...12343cf. Read the comment docs.