python-tuf/tuf/api
Martin Vrachev 6ea5372edb Take order into account for certain cases
After we have dropped OrderedDict in e3b267e2e0
we are relying on python3.7+ default behavior to preserve the insertion
order, but there is one caveat.
When comparing dictionaries the order is still irrelevant compared to
OrderedDict. For example:
>>> OrderedDict([(1,1), (2,2)]) == OrderedDict([(2,2), (1,1)])
False
>>> dict([(1,1), (2,2)]) == dict([(2,2), (1,1)])
True

There are two special attributes, defined in the specification, where
the order makes a difference when comparing two objects:
- Metadata.signatures
- Targets.delegations.roles.
We want to make sure that the order in those two cases makes a
difference when comparing two objects and that's why those changes
are required inside two __eq__ implementations.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2022-02-28 14:42:06 +02:00
..
serialization Add "validation" arg in JSONSerializer 2022-02-28 14:42:06 +02:00
__init__.py tuf/api: Expose tuf.api as a package 2020-10-15 14:35:14 +01:00
exceptions.py exceptions: rename FetcherHTTPError 2022-02-04 11:03:12 +02:00
metadata.py Take order into account for certain cases 2022-02-28 14:42:06 +02:00