We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d9a928e + 737c249 commit 0b54cafCopy full SHA for 0b54caf
tests/test_api.py
@@ -585,6 +585,13 @@ def test_metadata_targets(self):
585
targets.signed.targets[filename].to_dict(), fileinfo.to_dict()
586
)
587
588
+ # Test from_dict/to_dict Targets with empty targets.
589
+ targets_dict = copy.deepcopy(targets.to_dict())
590
+ targets_dict["signed"]["targets"] = {}
591
+ tmp_dict = copy.deepcopy(targets_dict["signed"])
592
+ targets_obj = Targets.from_dict(tmp_dict)
593
+ self.assertEqual(targets_dict["signed"], targets_obj.to_dict())
594
+
595
# Test from_dict/to_dict Targets without delegations
596
targets_dict = targets.to_dict()
597
del targets_dict["signed"]["delegations"]
0 commit comments