Skip to content

Commit 99997dc

Browse files
committed
Fix a typo in the test
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
1 parent 3e213e6 commit 99997dc

File tree

5 files changed

+151
-8
lines changed

5 files changed

+151
-8
lines changed

vulnerabilities/tests/pipelines/v2_importers/test_collect_issue_pr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def test_collect_advisories_from_json(input_file, expected_file, repo_url, pipel
120120
pipeline.repo_url = repo_url
121121
pipeline.log = MagicMock()
122122

123-
pipeline.collect_items = MagicMock(return_value=issues_and_prs)
123+
pipeline.collected_items = issues_and_prs
124124

125125
result = [adv.to_dict() for adv in pipeline.collect_advisories()]
126126
util_tests.check_results_against_json(result, expected_file)
Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,61 @@
1-
[]
1+
[
2+
{
3+
"advisory_id": "CVE-2023-1234",
4+
"aliases": [],
5+
"summary": "",
6+
"affected_packages": [],
7+
"references": [
8+
{
9+
"reference_id": "",
10+
"reference_type": "Issue",
11+
"url": "https://github.com/aboutcode-org/vulnerablecode/issues/1697"
12+
},
13+
{
14+
"reference_id": "",
15+
"reference_type": "PR",
16+
"url": "https://github.com/aboutcode-org/vulnerablecode/pull/2163"
17+
}
18+
],
19+
"patches": [],
20+
"severities": [],
21+
"date_published": null,
22+
"weaknesses": [],
23+
"url": "https://github.com/test/repo"
24+
},
25+
{
26+
"advisory_id": "GHSA-zzz-111",
27+
"aliases": [],
28+
"summary": "",
29+
"affected_packages": [],
30+
"references": [
31+
{
32+
"reference_id": "",
33+
"reference_type": "PR",
34+
"url": "https://github.com/aboutcode-org/vulnerablecode/pull/2164"
35+
}
36+
],
37+
"patches": [],
38+
"severities": [],
39+
"date_published": null,
40+
"weaknesses": [],
41+
"url": "https://github.com/test/repo"
42+
},
43+
{
44+
"advisory_id": "PYSEC-2024-5678",
45+
"aliases": [],
46+
"summary": "",
47+
"affected_packages": [],
48+
"references": [
49+
{
50+
"reference_id": "",
51+
"reference_type": "PR",
52+
"url": "https://github.com/aboutcode-org/vulnerablecode/pull/2169"
53+
}
54+
],
55+
"patches": [],
56+
"severities": [],
57+
"date_published": null,
58+
"weaknesses": [],
59+
"url": "https://github.com/test/repo"
60+
}
61+
]
Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,61 @@
1-
[]
1+
[
2+
{
3+
"advisory_id": "CVE-2023-1234",
4+
"aliases": [],
5+
"summary": "",
6+
"affected_packages": [],
7+
"references": [
8+
{
9+
"reference_id": "",
10+
"reference_type": "Issue",
11+
"url": "https://example.com/issue1"
12+
},
13+
{
14+
"reference_id": "",
15+
"reference_type": "PR",
16+
"url": "https://example.com/pr1"
17+
}
18+
],
19+
"patches": [],
20+
"severities": [],
21+
"date_published": null,
22+
"weaknesses": [],
23+
"url": "https://gitlab.com/test/repo"
24+
},
25+
{
26+
"advisory_id": "GHSA-zzz-111",
27+
"aliases": [],
28+
"summary": "",
29+
"affected_packages": [],
30+
"references": [
31+
{
32+
"reference_id": "",
33+
"reference_type": "PR",
34+
"url": "https://example.com/pr1"
35+
}
36+
],
37+
"patches": [],
38+
"severities": [],
39+
"date_published": null,
40+
"weaknesses": [],
41+
"url": "https://gitlab.com/test/repo"
42+
},
43+
{
44+
"advisory_id": "PYSEC-2024-5678",
45+
"aliases": [],
46+
"summary": "",
47+
"affected_packages": [],
48+
"references": [
49+
{
50+
"reference_id": "",
51+
"reference_type": "PR",
52+
"url": "https://example.com/pr1"
53+
}
54+
],
55+
"patches": [],
56+
"severities": [],
57+
"date_published": null,
58+
"weaknesses": [],
59+
"url": "https://gitlab.com/test/repo"
60+
}
61+
]

vulnerabilities/tests/test_data/collect_issue_pr/github_issues_and_pr.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
"CVE-2023-1234": [
33
[
44
"Issue",
5-
"https://example.com/issue1"
5+
"https://github.com/aboutcode-org/vulnerablecode/issues/1697"
66
],
77
[
88
"PR",
9-
"https://example.com/pr1"
9+
"https://github.com/aboutcode-org/vulnerablecode/pull/2163"
1010
]
1111
],
1212
"GHSA-zzz-111": [
1313
[
1414
"PR",
15-
"https://example.com/pr1"
15+
"https://github.com/aboutcode-org/vulnerablecode/pull/2164"
1616
]
1717
],
1818
"PYSEC-2024-5678": [
1919
[
2020
"PR",
21-
"https://example.com/pr1"
21+
"https://github.com/aboutcode-org/vulnerablecode/pull/2169"
2222
]
2323
]
2424
}
Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,24 @@
1-
{}
1+
{
2+
"CVE-2023-1234": [
3+
[
4+
"Issue",
5+
"https://example.com/issue1"
6+
],
7+
[
8+
"PR",
9+
"https://example.com/pr1"
10+
]
11+
],
12+
"GHSA-zzz-111": [
13+
[
14+
"PR",
15+
"https://example.com/pr1"
16+
]
17+
],
18+
"PYSEC-2024-5678": [
19+
[
20+
"PR",
21+
"https://example.com/pr1"
22+
]
23+
]
24+
}

0 commit comments

Comments
 (0)