Skip to content

Commit 58a5634

Browse files
committed
change dataclassification to data in enum test
Signed-off-by: [email protected] <[email protected]>
1 parent 55bab7b commit 58a5634

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

cyclonedx/model/service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __init__(
6161
endpoints: Optional[Iterable[XsUri]] = None,
6262
authenticated: Optional[bool] = None,
6363
x_trust_boundary: Optional[bool] = None,
64-
data: Optional[Iterable[DataClassification]] = None,
64+
data: Optional[Iterable['Data']] = None,
6565
licenses: Optional[Iterable[License]] = None,
6666
external_references: Optional[Iterable[ExternalReference]] = None,
6767
properties: Optional[Iterable[Property]] = None,
@@ -626,12 +626,12 @@ def destination(self, destination: Optional[Iterable[Union[BomRef, XsUri]]]) ->
626626
self._destination = destination
627627

628628
def __eq__(self, other: object) -> bool:
629-
if isinstance(other, DataClassification):
629+
if isinstance(other, Data):
630630
return hash(other) == hash(self)
631631
return False
632632

633633
def __lt__(self, other: object) -> bool:
634-
if isinstance(other, DataClassification):
634+
if isinstance(other, Data):
635635
return _ComparableTuple((
636636
self.flow, self.classification
637637
)) < _ComparableTuple((

tests/test_enums.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from cyclonedx.model.component import Component, Patch, Pedigree
3535
from cyclonedx.model.issue import IssueType
3636
from cyclonedx.model.license import DisjunctiveLicense
37-
from cyclonedx.model.service import DataClassification, Service
37+
from cyclonedx.model.service import Data, Service
3838
from cyclonedx.model.vulnerability import (
3939
BomTarget,
4040
BomTargetVersionRange,
@@ -168,7 +168,8 @@ def test_knows_value(self, value: str) -> None:
168168
@patch('cyclonedx.model.ThisTool._version', 'TESTING')
169169
def test_cases_render_valid(self, of: OutputFormat, sv: SchemaVersion, *_: Any, **__: Any) -> None:
170170
bom = _make_bom(services=[Service(name='dummy', bom_ref='dummy', data=(
171-
DataClassification(flow=df, classification=df.name)
171+
Data(flow=df, classification=df.name)
172+
# DataClassification(flow=df, classification=df.name)
172173
for df in DataFlow
173174
))])
174175
super()._test_cases_render(bom, of, sv)

0 commit comments

Comments
 (0)