Page MenuHomeSoftware Heritage

Add assertOriginMetadataOk.
ClosedPublic

Authored by vlorentz on Nov 27 2018, 6:47 PM.

Details

Reviewers
anlambert
Group Reviewers
Reviewers
Test Plan

Has no proper test yet (T1393). I'm going to send a diff that uses it for swh.deposit.

Diff Detail

Repository
rDLDBASE Generic VCS/Package Loader
Branch
assertOriginMetadataOk
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 2743
Build 3435: tox-on-jenkinsJenkins
Build 3434: arc lint + arc unit

Event Timeline

zack added inline comments.
swh/loader/core/tests/__init__.py
135

I realize this it not a problem introduced by this diffs, but FWIW the naming of all these assertion should be assertFooEqual, not assertFooOk, because that is what they're testing.

If would be just awesome if you could take the chance of this change to refactor that :-)

Your example, though, makes this distinction particularly relevant. Because for metadata (which are dictionaries) it would make sense to both asserts equality and to assert that the expected metadata are a subset of the obtained one, as in the future we might end up detecting more metadata, and making old tests failing only due to that might not be what we want, at least in some cases.

This revision is now accepted and ready to land.Dec 4 2018, 4:26 PM
vlorentz added inline comments.
swh/loader/core/tests/__init__.py
135

Done in D772