-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from sw360/feat-multiple-sources
project CreateBom: add multiple and self-made sources to SBOM
- Loading branch information
Showing
4 changed files
with
98 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,6 +158,17 @@ def test_project_by_id(self): | |
release = self.get_release_cli_for_test() | ||
# use a specific purl | ||
release["externalIds"]["package-url"] = "pkg:deb/debian/[email protected]" | ||
# add a SOURCE_SELF attachment | ||
release["_embedded"]["sw360:attachments"].append({ | ||
"filename": "clipython-repacked-for-fun.zip", | ||
"sha1": "face4b90d134e2a2bcf9464c50ea086f849a9b82", | ||
"attachmentType": "SOURCE_SELF", | ||
"_links": { | ||
"self": { | ||
"href": "https://my.server.com/resource/api/attachments/r002a002" | ||
} | ||
} | ||
}) | ||
responses.add( | ||
responses.GET, | ||
url=self.MYURL + "resource/api/releases/r002", | ||
|
@@ -177,7 +188,7 @@ def test_project_by_id(self): | |
self.assertEqual(ext_refs_src_url[0].type, ExternalReferenceType.DISTRIBUTION) | ||
|
||
ext_refs_src_file = [e for e in cx_comp.external_references if e.comment == CaPyCliBom.SOURCE_FILE_COMMENT] | ||
self.assertEqual(len(ext_refs_src_file), 1) | ||
self.assertEqual(len(ext_refs_src_file), 2) | ||
self.assertEqual(ext_refs_src_file[0].url, release["_embedded"]["sw360:attachments"][0]["filename"]) | ||
self.assertEqual(ext_refs_src_file[0].type, ExternalReferenceType.DISTRIBUTION) | ||
self.assertEqual(ext_refs_src_file[0].hashes[0].alg, "SHA-1") | ||
|