Page MenuHomeSoftware Heritage

Remove mocks from range tests of mimetype and license indexers.
ClosedPublic

Authored by vlorentz on Fri, Dec 7, 10:15 AM.

Details

Summary

Also fix hash types and add type checks.

Duplicate of D787, which I somehow messed up?

Diff Detail

Repository
rDCIDX Object indexer
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vlorentz created this revision.Fri, Dec 7, 10:15 AM
vlorentz updated this revision to Diff 2488.Fri, Dec 7, 10:45 AM
  • Un-mark xfail.
ardumont accepted this revision.Fri, Dec 7, 12:34 PM
ardumont added a subscriber: ardumont.
ardumont added inline comments.
swh/indexer/tests/test_utils.py
797

This test should go away as that was testing the input as hex (as it was optional to pass bytes at the time).
It's now redundant with the next one.

805

wrong docstring because it's bytes ;)

This revision is now accepted and ready to land.Fri, Dec 7, 12:34 PM

mmm, i accepted too fast.

ardumont requested changes to this revision.Fri, Dec 7, 12:35 PM
This revision now requires changes to proceed.Fri, Dec 7, 12:35 PM

Well, i requested changes only because i messed up. I did not have time to read it yet.
I'd like to untangle the diffs first.

vlorentz updated this revision to Diff 2496.Fri, Dec 7, 2:23 PM
  • rebase
ardumont added inline comments.Fri, Dec 7, 2:36 PM
swh/indexer/tests/test_utils.py
493

In that case, we should simplify obj_storage_data and let swh.model.hashtutil.MultiHash do its job altogether.
We most probably cannot do it right now as the assertion done in the tests will probably fail (due to hash computation mismatch).
Marking this as a fixme would be reasonable.

vlorentz updated this revision to Diff 2500.Fri, Dec 7, 2:44 PM
  • add TODO
ardumont accepted this revision.Fri, Dec 7, 2:48 PM
This revision is now accepted and ready to land.Fri, Dec 7, 2:48 PM
vlorentz updated this revision to Diff 2504.Fri, Dec 7, 5:02 PM
  • squash
This revision was automatically updated to reflect the committed changes.