Skip to content

Commit 8d51bde

Browse files
committed
tests
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent a7ef449 commit 8d51bde

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed

tests/_data/own/json/1.6/issue690.json

Lines changed: 97 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/test_deserialize_json.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,17 @@ def test(ls: LicenseRepository) -> None:
8282
test(bom.metadata.component.licenses)
8383
test(list(bom.components)[0].licenses)
8484
test(list(bom.services)[0].licenses)
85+
86+
def test_regression_issue690(self) -> None:
87+
"""
88+
regressio test for issue#690.
89+
see https://github.com/CycloneDX/cyclonedx-python-lib/issues/690
90+
"""
91+
json_file = join(OWN_DATA_DIRECTORY, 'json',
92+
SchemaVersion.V1_6.to_version(),
93+
'issue690.json')
94+
with open(json_file) as f:
95+
json = json_loads(f.read())
96+
bom: Bom = Bom.from_json(json) # <<< is expected to not crash
97+
self.assertIsNotNone(bom)
98+

0 commit comments

Comments
 (0)