Skip to content

Commit 273932b

Browse files
committed
use data instead of dataclassification for service in tests _data models
Signed-off-by: [email protected] <[email protected]>
1 parent 58a5634 commit 273932b

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

cyclonedx/model/service.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333

3434
from .._internal.compare import ComparableTuple as _ComparableTuple
3535
from ..schema.schema import SchemaVersion1Dot3, SchemaVersion1Dot4, SchemaVersion1Dot5, SchemaVersion1Dot6
36-
from . import DataClassification, DataFlow, ExternalReference, Property, XsUri
36+
from . import DataFlow, ExternalReference, Property, XsUri
37+
38+
# DataClassification,
3739
from .bom_ref import BomRef
3840
from .contact import OrganizationalEntity
3941
from .dependency import Dependable
@@ -252,18 +254,18 @@ def x_trust_boundary(self, x_trust_boundary: Optional[bool]) -> None:
252254
@property
253255
@serializable.xml_array(serializable.XmlArraySerializationType.NESTED, 'classification')
254256
@serializable.xml_sequence(10)
255-
def data(self) -> 'SortedSet[DataClassification]':
257+
def data(self) -> 'SortedSet[Data]':
256258
"""
257259
Specifies the data classification.
258260
259261
Returns:
260-
Set of `DataClassification`
262+
Set of `Data`
261263
"""
262264
# TODO since CDX1.5 also supports `dataflow`, not only `DataClassification`
263265
return self._data
264266

265267
@data.setter
266-
def data(self, data: Iterable[DataClassification]) -> None:
268+
def data(self, data: Iterable['Data']) -> None:
267269
self._data = SortedSet(data)
268270

269271
@property
@@ -643,4 +645,4 @@ def __hash__(self) -> int:
643645
return hash((self.flow, self.classification))
644646

645647
def __repr__(self) -> str:
646-
return f'<DataClassification flow={self.flow}>'
648+
return f'<Data flow={self.flow}>'

tests/_data/models.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626
# See https://github.com/package-url/packageurl-python/issues/65
2727
from packageurl import PackageURL
2828

29-
from cyclonedx.model import (
29+
from cyclonedx.model import ( # DataClassification,
3030
AttachedText,
3131
Copyright,
32-
DataClassification,
3332
DataFlow,
3433
Encoding,
3534
ExternalReference,
@@ -88,7 +87,7 @@
8887
from cyclonedx.model.issue import IssueClassification, IssueType, IssueTypeSource
8988
from cyclonedx.model.license import DisjunctiveLicense, License, LicenseAcknowledgement, LicenseExpression
9089
from cyclonedx.model.release_note import ReleaseNotes
91-
from cyclonedx.model.service import Service
90+
from cyclonedx.model.service import Data, Service
9291
from cyclonedx.model.vulnerability import (
9392
BomTarget,
9493
BomTargetVersionRange,
@@ -566,7 +565,7 @@ def get_bom_with_services_complex() -> Bom:
566565
XsUri('/api/thing/2')
567566
],
568567
authenticated=False, x_trust_boundary=True, data=[
569-
DataClassification(flow=DataFlow.OUTBOUND, classification='public')
568+
Data(flow=DataFlow.OUTBOUND, classification='public')
570569
],
571570
licenses=[DisjunctiveLicense(name='Commercial')],
572571
external_references=[
@@ -594,7 +593,7 @@ def get_bom_with_nested_services() -> Bom:
594593
XsUri('/api/thing/2')
595594
],
596595
authenticated=False, x_trust_boundary=True, data=[
597-
DataClassification(flow=DataFlow.OUTBOUND, classification='public')
596+
Data(flow=DataFlow.OUTBOUND, classification='public')
598597
],
599598
licenses=[DisjunctiveLicense(name='Commercial')],
600599
external_references=[

0 commit comments

Comments
 (0)