Extract the extra_headers from metadata on the Revision model class
Add a new extra_headers attribute on Revision and use it for computing the revision's id instead of extract it from the metadata field. Only accept (bytes, bytes) as extra_header. Add a post init hook to Revision to initialize this new attribute from given metadata, if any, for bw compat. Also amend the revision_d hyptothesis strategy to generate extra_headers.
Showing
- swh/model/hypothesis_strategies.py 8 additions, 0 deletionsswh/model/hypothesis_strategies.py
- swh/model/identifiers.py 7 additions, 16 deletionsswh/model/identifiers.py
- swh/model/model.py 27 additions, 1 deletionswh/model/model.py
- swh/model/tests/test_identifiers.py 9 additions, 13 deletionsswh/model/tests/test_identifiers.py
- swh/model/tests/test_model.py 188 additions, 0 deletionsswh/model/tests/test_model.py
Loading
Please register or sign in to comment