Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
  • Loading branch information
jkowalleck committed Oct 7, 2024
1 parent a7ef449 commit 8d51bde
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 0 deletions.
97 changes: 97 additions & 0 deletions tests/_data/own/json/1.6/issue690.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions tests/test_deserialize_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,17 @@ def test(ls: LicenseRepository) -> None:
test(bom.metadata.component.licenses)
test(list(bom.components)[0].licenses)
test(list(bom.services)[0].licenses)

def test_regression_issue690(self) -> None:
"""
regressio test for issue#690.
see https://github.com/CycloneDX/cyclonedx-python-lib/issues/690
"""
json_file = join(OWN_DATA_DIRECTORY, 'json',
SchemaVersion.V1_6.to_version(),
'issue690.json')
with open(json_file) as f:
json = json_loads(f.read())
bom: Bom = Bom.from_json(json) # <<< is expected to not crash
self.assertIsNotNone(bom)

0 comments on commit 8d51bde

Please sign in to comment.