@@ -20,6 +20,7 @@ def test_get_bugs_success(self, mock_api_call):
2020 mock_api_call .assert_called_once ()
2121 # check None keys are dropped
2222 mock_api_call .assert_called_with (self .bugzilla_client ._bugs_endpoint , params = {'Bugzilla_api_key' : 'test_key' , "product" : "Test Product" })
23+ # embargoed bug should have been dropped
2324 self .assertEqual (len (bugs ), 3 )
2425 for i in range (len (bugs )):
2526 bug : dict [str , Any ] = bugs [i ]
@@ -42,5 +43,37 @@ def test_parse_release_notes(self):
4243 # first line is not ----------------
4344 self .assertRaises (ValueError , self .bugzilla_client ._parse_release_notes , './tests/testdata/test_invalid_release_notes.changes' )
4445
46+ def test_bug_under_embargo (self ):
47+ bsc : dict [str , any ] = {
48+ "classification" : "Test" ,
49+ "component" : "Test components" ,
50+ "creation_time" : "2024-03-03T00:00:00Z" ,
51+ "creator" : "tester@suse.com" ,
52+ "deadline" : None ,
53+ "depends_on" : [],
54+ "id" : 3 ,
55+ "is_cc_accessible" : True ,
56+ "is_confirmed" : True ,
57+ "is_creator_accessible" : True ,
58+ "is_open" : True ,
59+ "priority" : "P0 - Critical" ,
60+ "product" : "Test Product" ,
61+ "remaining_time" : 0 ,
62+ "resolution" : "" ,
63+ "severity" : "High" ,
64+ "status" : "CONFIRMED" ,
65+ "summary" : "VUL-0: EMBARGOED: Test BSC" ,
66+ "version" : "Test"
67+ }
68+ # explicit mention in the summary
69+ self .assertTrue (self .bugzilla_client ._bug_under_embargo (bsc ))
70+ # no embargo mention
71+ bsc ['summary' ] = "CVE 123456789: Test BSC"
72+ self .assertFalse (self .bugzilla_client ._bug_under_embargo (bsc ))
73+ bsc ['summary' ] = "Test BSC"
74+ self .assertFalse (self .bugzilla_client ._bug_under_embargo (bsc ))
75+
76+
77+
4578if __name__ == '__main__' :
4679 unittest .main ()
0 commit comments