@@ -181,11 +181,14 @@ def test_undeclared_policy(self):
181
181
status , results = undeclared .run ()
182
182
details = json .loads (results ['details' ])
183
183
summary = results ['summary' ]
184
- expected_summary_output = """2 undeclared component(s) were found.
184
+ expected_summary_output = """3 undeclared component(s) were found.
185
185
Add the following snippet into your `sbom.json` file
186
186
```json
187
187
{
188
188
"components":[
189
+ {
190
+ "purl": "pkg:github/scanoss/jenkins-pipeline-example"
191
+ },
189
192
{
190
193
"purl": "pkg:github/scanoss/scanner.c"
191
194
},
@@ -195,7 +198,7 @@ def test_undeclared_policy(self):
195
198
]
196
199
}```
197
200
"""
198
- self .assertEqual (len (details ['components' ]), 3 )
201
+ self .assertEqual (len (details ['components' ]), 4 )
199
202
self .assertEqual (
200
203
re .sub (r'\s|\\(?!`)|\\(?=`)' , '' , summary ), re .sub (r'\s|\\(?!`)|\\(?=`)' , '' , expected_summary_output )
201
204
)
@@ -216,14 +219,18 @@ def test_undeclared_policy_markdown(self):
216
219
expected_details_output = """ ### Undeclared components
217
220
| Component | License |
218
221
| - | - |
222
+ | pkg:github/scanoss/jenkins-pipeline-example | unknown |
219
223
| pkg:github/scanoss/scanner.c | GPL-2.0-only |
220
224
| pkg:github/scanoss/wfp | GPL-2.0-only | """
221
225
222
- expected_summary_output = """2 undeclared component(s) were found.
226
+ expected_summary_output = """3 undeclared component(s) were found.
223
227
Add the following snippet into your `sbom.json` file
224
228
```json
225
229
{
226
230
"components":[
231
+ {
232
+ "purl": "pkg:github/scanoss/jenkins-pipeline-example"
233
+ },
227
234
{
228
235
"purl": "pkg:github/scanoss/scanner.c"
229
236
},
@@ -256,16 +263,20 @@ def test_undeclared_policy_markdown_scanoss_summary(self):
256
263
expected_details_output = """ ### Undeclared components
257
264
| Component | License |
258
265
| - | - |
266
+ | pkg:github/scanoss/jenkins-pipeline-example | unknown |
259
267
| pkg:github/scanoss/scanner.c | GPL-2.0-only |
260
268
| pkg:github/scanoss/wfp | GPL-2.0-only | """
261
269
262
- expected_summary_output = """2 undeclared component(s) were found.
270
+ expected_summary_output = """3 undeclared component(s) were found.
263
271
Add the following snippet into your `scanoss.json` file
264
272
265
273
```json
266
274
{
267
275
"bom": {
268
276
"include": [
277
+ {
278
+ "purl": "pkg:github/scanoss/jenkins-pipeline-example"
279
+ },
269
280
{
270
281
"purl": "pkg:github/scanoss/scanner.c"
271
282
},
@@ -296,13 +307,16 @@ def test_undeclared_policy_scanoss_summary(self):
296
307
status , results = undeclared .run ()
297
308
details = json .loads (results ['details' ])
298
309
summary = results ['summary' ]
299
- expected_summary_output = """2 undeclared component(s) were found.
310
+ expected_summary_output = """3 undeclared component(s) were found.
300
311
Add the following snippet into your `scanoss.json` file
301
312
302
313
```json
303
314
{
304
315
"bom": {
305
316
"include": [
317
+ {
318
+ "purl": "pkg:github/scanoss/jenkins-pipeline-example"
319
+ },
306
320
{
307
321
"purl": "pkg:github/scanoss/scanner.c"
308
322
},
@@ -314,7 +328,7 @@ def test_undeclared_policy_scanoss_summary(self):
314
328
}
315
329
```"""
316
330
self .assertEqual (status , 0 )
317
- self .assertEqual (len (details ['components' ]), 3 )
331
+ self .assertEqual (len (details ['components' ]), 4 )
318
332
self .assertEqual (
319
333
re .sub (r'\s|\\(?!`)|\\(?=`)' , '' , summary ), re .sub (r'\s|\\(?!`)|\\(?=`)' , '' , expected_summary_output )
320
334
)
@@ -328,15 +342,19 @@ def test_undeclared_policy_jira_markdown_output(self):
328
342
details = results ['details' ]
329
343
summary = results ['summary' ]
330
344
expected_details_output = """|*Component*|*License*|
345
+ |pkg:github/scanoss/jenkins-pipeline-example|unknown|
331
346
|pkg:github/scanoss/scanner.c|GPL-2.0-only|
332
347
|pkg:github/scanoss/wfp|GPL-2.0-only|
333
348
"""
334
- expected_summary_output = """2 undeclared component(s) were found.
349
+ expected_summary_output = """3 undeclared component(s) were found.
335
350
Add the following snippet into your `scanoss.json` file
336
351
{code:json}
337
352
{
338
353
"bom": {
339
354
"include": [
355
+ {
356
+ "purl": "pkg:github/scanoss/jenkins-pipeline-example"
357
+ },
340
358
{
341
359
"purl": "pkg:github/scanoss/scanner.c"
342
360
},
@@ -373,7 +391,7 @@ def test_inspect_license_summary(self):
373
391
input_file_name = os .path .join (script_dir , 'data' , file_name )
374
392
i_license_summary = LicenseSummary (filepath = input_file_name )
375
393
license_summary = i_license_summary .run ()
376
- self .assertEqual (license_summary ['detectedLicenses' ], 2 )
394
+ self .assertEqual (license_summary ['detectedLicenses' ], 3 )
377
395
self .assertEqual (license_summary ['detectedLicensesWithCopyleft' ], 1 )
378
396
379
397
def test_inspect_license_summary_with_empty_result (self ):
@@ -393,11 +411,11 @@ def test_inspect_component_summary(self):
393
411
i_component_summary = ComponentSummary (filepath = input_file_name )
394
412
component_summary = i_component_summary .run ()
395
413
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 )
398
416
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 )
401
419
self .assertEqual (component_summary ['totalFilesDeclared' ], 2 )
402
420
403
421
def test_inspect_component_summary_empty_result (self ):
0 commit comments