@@ -181,11 +181,14 @@ def test_undeclared_policy(self):
181181 status , results = undeclared .run ()
182182 details = json .loads (results ['details' ])
183183 summary = results ['summary' ]
184- expected_summary_output = """2 undeclared component(s) were found.
184+ expected_summary_output = """3 undeclared component(s) were found.
185185 Add the following snippet into your `sbom.json` file
186186 ```json
187187 {
188188 "components":[
189+ {
190+ "purl": "pkg:github/scanoss/jenkins-pipeline-example"
191+ },
189192 {
190193 "purl": "pkg:github/scanoss/scanner.c"
191194 },
@@ -195,7 +198,7 @@ def test_undeclared_policy(self):
195198 ]
196199 }```
197200 """
198- self .assertEqual (len (details ['components' ]), 3 )
201+ self .assertEqual (len (details ['components' ]), 4 )
199202 self .assertEqual (
200203 re .sub (r'\s|\\(?!`)|\\(?=`)' , '' , summary ), re .sub (r'\s|\\(?!`)|\\(?=`)' , '' , expected_summary_output )
201204 )
@@ -216,14 +219,18 @@ def test_undeclared_policy_markdown(self):
216219 expected_details_output = """ ### Undeclared components
217220 | Component | License |
218221 | - | - |
222+ | pkg:github/scanoss/jenkins-pipeline-example | unknown |
219223 | pkg:github/scanoss/scanner.c | GPL-2.0-only |
220224 | pkg:github/scanoss/wfp | GPL-2.0-only | """
221225
222- expected_summary_output = """2 undeclared component(s) were found.
226+ expected_summary_output = """3 undeclared component(s) were found.
223227 Add the following snippet into your `sbom.json` file
224228 ```json
225229 {
226230 "components":[
231+ {
232+ "purl": "pkg:github/scanoss/jenkins-pipeline-example"
233+ },
227234 {
228235 "purl": "pkg:github/scanoss/scanner.c"
229236 },
@@ -256,16 +263,20 @@ def test_undeclared_policy_markdown_scanoss_summary(self):
256263 expected_details_output = """ ### Undeclared components
257264 | Component | License |
258265 | - | - |
266+ | pkg:github/scanoss/jenkins-pipeline-example | unknown |
259267 | pkg:github/scanoss/scanner.c | GPL-2.0-only |
260268 | pkg:github/scanoss/wfp | GPL-2.0-only | """
261269
262- expected_summary_output = """2 undeclared component(s) were found.
270+ expected_summary_output = """3 undeclared component(s) were found.
263271 Add the following snippet into your `scanoss.json` file
264272
265273 ```json
266274 {
267275 "bom": {
268276 "include": [
277+ {
278+ "purl": "pkg:github/scanoss/jenkins-pipeline-example"
279+ },
269280 {
270281 "purl": "pkg:github/scanoss/scanner.c"
271282 },
@@ -296,13 +307,16 @@ def test_undeclared_policy_scanoss_summary(self):
296307 status , results = undeclared .run ()
297308 details = json .loads (results ['details' ])
298309 summary = results ['summary' ]
299- expected_summary_output = """2 undeclared component(s) were found.
310+ expected_summary_output = """3 undeclared component(s) were found.
300311 Add the following snippet into your `scanoss.json` file
301312
302313 ```json
303314 {
304315 "bom": {
305316 "include": [
317+ {
318+ "purl": "pkg:github/scanoss/jenkins-pipeline-example"
319+ },
306320 {
307321 "purl": "pkg:github/scanoss/scanner.c"
308322 },
@@ -314,7 +328,7 @@ def test_undeclared_policy_scanoss_summary(self):
314328 }
315329 ```"""
316330 self .assertEqual (status , 0 )
317- self .assertEqual (len (details ['components' ]), 3 )
331+ self .assertEqual (len (details ['components' ]), 4 )
318332 self .assertEqual (
319333 re .sub (r'\s|\\(?!`)|\\(?=`)' , '' , summary ), re .sub (r'\s|\\(?!`)|\\(?=`)' , '' , expected_summary_output )
320334 )
@@ -328,15 +342,19 @@ def test_undeclared_policy_jira_markdown_output(self):
328342 details = results ['details' ]
329343 summary = results ['summary' ]
330344 expected_details_output = """|*Component*|*License*|
345+ |pkg:github/scanoss/jenkins-pipeline-example|unknown|
331346|pkg:github/scanoss/scanner.c|GPL-2.0-only|
332347|pkg:github/scanoss/wfp|GPL-2.0-only|
333348"""
334- expected_summary_output = """2 undeclared component(s) were found.
349+ expected_summary_output = """3 undeclared component(s) were found.
335350Add the following snippet into your `scanoss.json` file
336351{code:json}
337352{
338353 "bom": {
339354 "include": [
355+ {
356+ "purl": "pkg:github/scanoss/jenkins-pipeline-example"
357+ },
340358 {
341359 "purl": "pkg:github/scanoss/scanner.c"
342360 },
@@ -373,7 +391,7 @@ def test_inspect_license_summary(self):
373391 input_file_name = os .path .join (script_dir , 'data' , file_name )
374392 i_license_summary = LicenseSummary (filepath = input_file_name )
375393 license_summary = i_license_summary .run ()
376- self .assertEqual (license_summary ['detectedLicenses' ], 2 )
394+ self .assertEqual (license_summary ['detectedLicenses' ], 3 )
377395 self .assertEqual (license_summary ['detectedLicensesWithCopyleft' ], 1 )
378396
379397 def test_inspect_license_summary_with_empty_result (self ):
@@ -393,11 +411,11 @@ def test_inspect_component_summary(self):
393411 i_component_summary = ComponentSummary (filepath = input_file_name )
394412 component_summary = i_component_summary .run ()
395413 print (component_summary )
396- self .assertEqual (component_summary ['totalComponents' ], 3 )
397- self .assertEqual (component_summary ['undeclaredComponents' ], 2 )
414+ self .assertEqual (component_summary ['totalComponents' ], 4 )
415+ self .assertEqual (component_summary ['undeclaredComponents' ], 3 )
398416 self .assertEqual (component_summary ['declaredComponents' ], 1 )
399- self .assertEqual (component_summary ['totalFilesDetected' ], 7 )
400- self .assertEqual (component_summary ['totalFilesUndeclared' ], 5 )
417+ self .assertEqual (component_summary ['totalFilesDetected' ], 8 )
418+ self .assertEqual (component_summary ['totalFilesUndeclared' ], 6 )
401419 self .assertEqual (component_summary ['totalFilesDeclared' ], 2 )
402420
403421 def test_inspect_component_summary_empty_result (self ):
0 commit comments