@@ -40,10 +40,13 @@ class DummyCommit:
4040def test_collect_fix_commits_groups_by_vuln (mock_repo , pipeline ):
4141 commit1 = MagicMock (message = "Fix CVE-2021-0001" , hexsha = "abc123" )
4242 commit2 = MagicMock (message = "Patch GHSA-f72r-2h5j-7639" , hexsha = "def456" )
43- commit3 = MagicMock (message = "Unrelated change" , hexsha = "ghi789" )
43+ commit3 = MagicMock (
44+ message = "Patch GHSA-5w93-4g67-mm43" , hexsha = "Github Advisory: GHSA-5w93-4g67-mm43"
45+ )
46+ commit4 = MagicMock (message = "Unrelated change" , hexsha = "ghi789" )
4447
4548 pipeline .repo = MagicMock ()
46- pipeline .repo .iter_commits .return_value = [commit1 , commit2 , commit3 ]
49+ pipeline .repo .iter_commits .return_value = [commit1 , commit2 , commit3 , commit4 ]
4750
4851 pipeline .classify_commit_type = MagicMock (
4952 side_effect = lambda c : (
@@ -59,6 +62,9 @@ def test_collect_fix_commits_groups_by_vuln(mock_repo, pipeline):
5962
6063 expected = {
6164 "CVE-2021-0001" : [("abc123" , "Fix CVE-2021-0001" )],
65+ "GHSA-5w93-4g67-mm43" : [
66+ ("Github Advisory: GHSA-5w93-4g67-mm43" , "Patch GHSA-5w93-4g67-mm43" )
67+ ],
6268 "GHSA-f72r-2h5j-7639" : [("def456" , "Patch GHSA-f72r-2h5j-7639" )],
6369 }
6470
0 commit comments