File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -648,6 +648,7 @@ def to_dict(self):
648648 def from_dict (cls , advisory_data ):
649649 date_published = advisory_data ["date_published" ]
650650 transformed = {
651+ "advisory_id" : advisory_data ["advisory_id" ],
651652 "aliases" : advisory_data ["aliases" ],
652653 "summary" : advisory_data ["summary" ],
653654 "affected_packages" : [
Original file line number Diff line number Diff line change @@ -254,3 +254,10 @@ def test_content_id_from_adv_data_and_adv_model_are_same(self):
254254 id_from_model = utils .compute_content_id_v2 (advisory_model )
255255
256256 self .assertEqual (id_from_data , id_from_model )
257+
258+ def test_content_id_from_adv_data_roundtrip_are_same (self ):
259+ id_from_data = utils .compute_content_id_v2 (self .advisory1 )
260+ adv_roundtrip = AdvisoryDataV2 .from_dict (self .advisory1 .to_dict ())
261+ id_from_roundtrip = utils .compute_content_id_v2 (adv_roundtrip )
262+
263+ self .assertEqual (id_from_data , id_from_roundtrip )
You can’t perform that action at this time.
0 commit comments