Skip to content

Commit de53cf8

Browse files
committed
refactor
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
1 parent 3af721b commit de53cf8

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

cyclonedx/output/json.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@
4141
from ..model.bom import Bom
4242

4343

44-
class _BomDependencyGraphFlattener():
44+
class _BomDependencyGraphFlattener:
45+
"""
46+
!!! THIS CLASS IS INTERNAL.
47+
Everything might change without any notice.
48+
"""
49+
4550
def __init__(self, bom: 'Bom'):
4651
self._bom = bom
4752
# do NOT use the getter - see `reset()` for reasons
@@ -54,7 +59,7 @@ def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None:
5459
self.reset()
5560

5661
def reset(self) -> None:
57-
# do NOT use the setter - this would create overhead and most importantly,
62+
# Do NOT use the setter - this would create overhead and most importantly,
5863
# and this could cause deduplication of an existing malformed set.
5964
# Just access the internal field directly!
6065
self._bom._dependencies = self._deps

tests/test_output_json.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,11 @@ def test_get_outputter_expected(self, sv: SchemaVersion) -> None:
116116
outputter = outputter_class(Mock(spec=Bom))
117117
self.assertIs(outputter.schema_version, sv)
118118
self.assertIs(outputter.output_format, OutputFormat.JSON)
119+
120+
121+
class TestBomDependencyGraphFlattener(TestCase):
122+
def test_discriminate_and_reset_with(self) -> None:
123+
... # TODO
124+
125+
def test_discriminate_and_reset_manually(self) -> None:
126+
... # TODO

0 commit comments

Comments
 (0)