Skip to content

Commit cfb26e2

Browse files
committed
wip
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent c781c41 commit cfb26e2

File tree

4 files changed

+51
-4
lines changed

4 files changed

+51
-4
lines changed

tests/_data/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,7 @@ def get_bom_with_definitions_and_detailed_standards() -> Bom:
14011401
]))
14021402

14031403
def get_bom_regression_issue540() -> Bom:
1404+
# tests https://github.com/CycloneDX/cyclonedx-python-lib/issues/540
14041405
bom = _make_bom()
14051406
bom.metadata.component = root_component = Component(
14061407
name='myApp',

tests/_data/own/json/1.5/duplicate_components.json renamed to tests/_data/own/json/1.5/issue677.json

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

tests/_data/own/json/1.5/issue753.json

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

tests/test_real_world_examples.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,18 @@ def test_regression_issue_630(self, *_: Any, **__: Any) -> None:
3838
with open(join(OWN_DATA_DIRECTORY, 'xml', '1.6', 'regression_issue630.xml')) as input_xml:
3939
Bom.from_xml(input_xml)
4040

41-
def test_merged_bom_duplicate_component(self, *_: Any, **__: Any) -> None:
42-
with open(join(OWN_DATA_DIRECTORY, 'json', '1.5', 'duplicate_components.json')) as input_json:
41+
def test_regression_issue677(self, *_: Any, **__: Any) -> None:
42+
# tests https://github.com/CycloneDX/cyclonedx-python-lib/issues/677
43+
with open(join(OWN_DATA_DIRECTORY, 'json', '1.5', 'issue677.json')) as input_json:
4344
json = json_loads(input_json.read())
45+
bom = Bom.from_json(json)
46+
self.assertEqual(4, len(bom.components))
47+
bom.validate()
4448

49+
def test_regression_issue753(self, *_: Any, **__: Any) -> None:
50+
# tests https://github.com/CycloneDX/cyclonedx-python-lib/issues/753
51+
with open(join(OWN_DATA_DIRECTORY, 'json', '1.5', 'issue753.json')) as input_json:
52+
json = json_loads(input_json.read())
4553
bom = Bom.from_json(json)
46-
self.assertEqual(4, len(bom.components)) # tests https://github.com/CycloneDX/cyclonedx-python-lib/issues/540
47-
bom.validate() # tests https://github.com/CycloneDX/cyclonedx-python-lib/issues/677
54+
self.assertEqual(2, len(bom.components))
55+
bom.validate()

0 commit comments

Comments
 (0)