Skip to content

Commit 0e31022

Browse files
committed
feat: remove NoPropertiesProvidedException
did a global search and found these file/classes raising this exception File - Class model/__init__.py - IdentifiableAction model/component.py - Commit model/component.py - ComponentEvidence model/component.py - Diff model/component.py - Pedigree model/issue.py - IssueTypeSource model/model.py - BomTargetVersionRange model/model.py - VulnerabilityAnalysis model/model.py - VulnerabilitySource model/model.py - VulnerabilityReference model/model.py - VulnerabilityRating model/model.py - VulnerabilityCredits Signed-off-by: Indivar Mishra <indimishra@gmail.com>
1 parent e2a4ed3 commit 0e31022

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

cyclonedx/model/__init__.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@
3737
from sortedcontainers import SortedSet
3838

3939
from .._internal.compare import ComparableTuple as _ComparableTuple
40-
from ..exception.model import (
41-
InvalidLocaleTypeException,
42-
InvalidUriException,
43-
NoPropertiesProvidedException,
44-
UnknownHashTypeException,
45-
)
40+
from ..exception.model import InvalidLocaleTypeException, InvalidUriException, UnknownHashTypeException
4641
from ..exception.serialization import CycloneDxDeserializationException, SerializationOfUnexpectedValueException
4742
from ..schema.schema import (
4843
SchemaVersion1Dot0,
@@ -1180,11 +1175,6 @@ def __init__(
11801175
name: Optional[str] = None,
11811176
email: Optional[str] = None,
11821177
) -> None:
1183-
if not timestamp and not name and not email:
1184-
raise NoPropertiesProvidedException(
1185-
'At least one of `timestamp`, `name` or `email` must be provided for an `IdentifiableAction`.'
1186-
)
1187-
11881178
self.timestamp = timestamp
11891179
self.name = name
11901180
self.email = email

tests/test_model.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@
2424
from ddt import ddt, named_data
2525

2626
from cyclonedx._internal.compare import ComparableTuple
27-
from cyclonedx.exception.model import (
28-
InvalidLocaleTypeException,
29-
InvalidUriException,
30-
NoPropertiesProvidedException,
31-
UnknownHashTypeException,
32-
)
27+
from cyclonedx.exception.model import InvalidLocaleTypeException, InvalidUriException, UnknownHashTypeException
3328
from cyclonedx.model import (
3429
Copyright,
3530
Encoding,
@@ -308,10 +303,6 @@ def test_sort(self) -> None:
308303

309304
class TestModelIdentifiableAction(TestCase):
310305

311-
def test_no_params(self) -> None:
312-
with self.assertRaises(NoPropertiesProvidedException):
313-
IdentifiableAction()
314-
315306
def test_same(self) -> None:
316307
ts = datetime.datetime.utcnow()
317308
ia_1 = IdentifiableAction(timestamp=ts, name='A Name', email='something@somewhere.tld')

0 commit comments

Comments
 (0)