Skip to content

Commit 1aab412

Browse files
committed
chore:Fixes policy inspect unit tests
1 parent 9f33d13 commit 1aab412

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

tests/test_policy_inspect.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_copyleft_policy_explicit(self):
114114
copyleft = Copyleft(filepath=input_file_name, format_type='json', explicit='MIT')
115115
status, results = copyleft.run()
116116
details = json.loads(results['details'])
117-
self.assertEqual(len(details['components']), 3)
117+
self.assertEqual(len(details['components']), 2)
118118
self.assertEqual(status, 0)
119119

120120
"""
@@ -144,11 +144,10 @@ def test_copyleft_policy_markdown(self):
144144
expected_detail_output = (
145145
'### Copyleft licenses \n | Component | Version | License | URL | Copyleft |\n'
146146
' | - | :-: | - | - | :-: |\n'
147-
'| pkg:github/scanoss/engine | 4.0.4 | MIT | https://spdx.org/licenses/MIT.html | YES | \n'
148147
' | pkg:npm/%40electron/rebuild | 3.7.0 | MIT | https://spdx.org/licenses/MIT.html | YES |\n'
149148
'| pkg:npm/%40emotion/react | 11.13.3 | MIT | https://spdx.org/licenses/MIT.html | YES | \n'
150149
)
151-
expected_summary_output = '3 component(s) with copyleft licenses were found.\n'
150+
expected_summary_output = '2 component(s) with copyleft licenses were found.\n'
152151
self.assertEqual(
153152
re.sub(r'\s|\\(?!`)|\\(?=`)', '', results['details']),
154153
re.sub(r'\s|\\(?!`)|\\(?=`)', '', expected_detail_output),
@@ -214,9 +213,9 @@ def test_undeclared_policy_markdown(self):
214213
expected_details_output = """ ### Undeclared components
215214
| Component | Version | License |
216215
| - | - | - |
217-
| pkg:github/scanoss/scanner.c | 1.3.3 | BSD-2-Clause - GPL-2.0-only |
216+
| pkg:github/scanoss/scanner.c | 1.3.3 | GPL-2.0-only |
218217
| pkg:github/scanoss/scanner.c | 1.1.4 | GPL-2.0-only |
219-
| pkg:github/scanoss/wfp | 6afc1f6 | Zlib - GPL-2.0-only | """
218+
| pkg:github/scanoss/wfp | 6afc1f6 | GPL-2.0-only | """
220219

221220
expected_summary_output = """3 undeclared component(s) were found.
222221
Add the following snippet into your `sbom.json` file
@@ -257,9 +256,9 @@ def test_undeclared_policy_markdown_scanoss_summary(self):
257256
expected_details_output = """ ### Undeclared components
258257
| Component | Version | License |
259258
| - | - | - |
260-
| pkg:github/scanoss/scanner.c | 1.3.3 | BSD-2-Clause - GPL-2.0-only |
259+
| pkg:github/scanoss/scanner.c | 1.3.3 | GPL-2.0-only |
261260
| pkg:github/scanoss/scanner.c | 1.1.4 | GPL-2.0-only |
262-
| pkg:github/scanoss/wfp | 6afc1f6 | Zlib - GPL-2.0-only | """
261+
| pkg:github/scanoss/wfp | 6afc1f6 | GPL-2.0-only | """
263262

264263
expected_summary_output = """3 undeclared component(s) were found.
265264
Add the following snippet into your `scanoss.json` file
@@ -332,9 +331,9 @@ def test_undeclared_policy_jira_markdown_output(self):
332331
details = results['details']
333332
summary = results['summary']
334333
expected_details_output = """|*Component*|*Version*|*License*|
335-
|pkg:github/scanoss/scanner.c|1.3.3|BSD-2-Clause - GPL-2.0-only|
334+
|pkg:github/scanoss/scanner.c|1.3.3|GPL-2.0-only|
336335
|pkg:github/scanoss/scanner.c|1.1.4|GPL-2.0-only|
337-
|pkg:github/scanoss/wfp|6afc1f6|Zlib - GPL-2.0-only|
336+
|pkg:github/scanoss/wfp|6afc1f6|GPL-2.0-only|
338337
"""
339338
expected_summary_output = """3 undeclared component(s) were found.
340339
Add the following snippet into your `scanoss.json` file

0 commit comments

Comments
 (0)