Skip to content

Commit f0ff62a

Browse files
committed
tests: test case from PR#899
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
1 parent 868b95e commit f0ff62a

2 files changed

Lines changed: 182 additions & 0 deletions

File tree

tests/_data/own/json/1.6/pr899.json

Lines changed: 170 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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,15 @@ def test_component_evidence_identity(self) -> None:
136136
json = json_loads(f.read())
137137
bom: Bom = Bom.from_json(json) # <<< is expected to not crash
138138
self.assertIsNotNone(bom)
139+
140+
def test_pr899(self) -> None:
141+
"""real world case from PR#899
142+
see https://github.com/CycloneDX/cyclonedx-python-lib/pull/899
143+
"""
144+
json_file = join(OWN_DATA_DIRECTORY, 'json',
145+
SchemaVersion.V1_6.to_version(),
146+
'pr899.json')
147+
with open(json_file) as f:
148+
json = json_loads(f.read())
149+
bom: Bom = Bom.from_json(json) # <<< is expected to not crash
150+
self.assertIsNotNone(bom)

0 commit comments

Comments
 (0)