Skip to content

Commit 329c65d

Browse files
committed
Merge branch 'develop' into modernize-metadata
2 parents 802caff + 8ac7167 commit 329c65d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

tests/test_metadata_serialization.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,15 @@ def test_invalid_metadata_serialization(self, test_data: bytes) -> None:
8080
@utils.run_sub_tests_with_dataset(valid_metadata)
8181
def test_valid_metadata_serialization(self, test_case_data: bytes) -> None:
8282
md = Metadata.from_bytes(test_case_data)
83-
input_dict = json.loads(test_case_data)
84-
self.assertDictEqual(input_dict, md.to_dict())
83+
84+
# Convert to a JSON and sort the keys the way we do in JSONSerializer.
85+
separators = (",", ":")
86+
test_json = json.loads(test_case_data)
87+
test_bytes = json.dumps(
88+
test_json, separators=separators, sort_keys=True
89+
).encode("utf-8")
90+
91+
self.assertEqual(test_bytes, md.to_bytes())
8592

8693
invalid_signatures: utils.DataSet = {
8794
"missing keyid attribute in a signature": '{ "sig": "abc" }',

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
isolated_build = true
7+
isolated_build=true
88
envlist = lint,docs,py
99
skipsdist = true
1010

0 commit comments

Comments
 (0)