Page MenuHomeSoftware Heritage

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

Authored by vlorentz on Dec 7 2018, 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 Metadata indexer
Branch
mimetypes-licenses-mock-ranges
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 2917
Build 3703: tox-on-jenkinsJenkins
Build 3702: arc lint + arc unit

Event Timeline

ardumont added a subscriber: ardumont.
ardumont added inline comments.
swh/indexer/tests/test_utils.py
796

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.

804

wrong docstring because it's bytes ;)

This revision is now accepted and ready to land.Dec 7 2018, 12:34 PM
This revision now requires changes to proceed.Dec 7 2018, 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.

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.

This revision is now accepted and ready to land.Dec 7 2018, 2:48 PM
This revision was automatically updated to reflect the committed changes.