|
22 | 22 | from uuid import UUID
|
23 | 23 |
|
24 | 24 | from ddt import ddt, named_data
|
25 |
| -from sortedcontainers import SortedSet |
26 | 25 |
|
27 | 26 | from cyclonedx._internal.compare import ComparableTuple
|
28 | 27 | from cyclonedx.exception.model import InvalidLocaleTypeException, InvalidUriException, UnknownHashTypeException
|
|
40 | 39 | XsUri,
|
41 | 40 | )
|
42 | 41 | from cyclonedx.model.bom_ref import BomRef
|
43 |
| -from cyclonedx.model.contact import OrganizationalContact, OrganizationalEntity, PostalAddress |
| 42 | +from cyclonedx.model.contact import OrganizationalContact |
44 | 43 | from cyclonedx.model.issue import IssueClassification, IssueType, IssueTypeSource
|
45 | 44 | from tests import reorder
|
46 | 45 |
|
@@ -464,67 +463,6 @@ def test_sort(self) -> None:
|
464 | 463 | self.assertListEqual(sorted_contacts, expected_contacts)
|
465 | 464 |
|
466 | 465 |
|
467 |
| -class TestModelOrganizationalEntity(TestCase): |
468 |
| - def test_init_with_bom_ref(self) -> None: |
469 |
| - contacts = [ |
470 |
| - OrganizationalContact(name='a', email='a', phone='a'), |
471 |
| - OrganizationalContact(name='b', email='a', phone='a'), |
472 |
| - ] |
473 |
| - OrganizationalEntity( |
474 |
| - bom_ref=BomRef('dummy-bom-ref'), |
475 |
| - name='dummy-organizational-entity', |
476 |
| - contacts=contacts, |
477 |
| - address=PostalAddress( |
478 |
| - country='dummy-country', |
479 |
| - region='dummy-region', |
480 |
| - ), |
481 |
| - ) |
482 |
| - |
483 |
| - def test_init_without_bom_ref(self) -> None: |
484 |
| - contacts = [ |
485 |
| - OrganizationalContact(name='a', email='a', phone='a'), |
486 |
| - OrganizationalContact(name='b', email='a', phone='a'), |
487 |
| - ] |
488 |
| - OrganizationalEntity( |
489 |
| - name='dummy-organizational-entity', |
490 |
| - contacts=contacts, |
491 |
| - address=PostalAddress( |
492 |
| - country='dummy-country', |
493 |
| - region='dummy-region', |
494 |
| - ), |
495 |
| - ) |
496 |
| - |
497 |
| - def test_init_from_json(self) -> None: |
498 |
| - bom_ref = 'Example' |
499 |
| - name = 'Example' |
500 |
| - urls = [ |
501 |
| - 'https://example.com/' |
502 |
| - ] |
503 |
| - specification = { |
504 |
| - 'name': name, |
505 |
| - 'url': urls, |
506 |
| - 'bom-ref': bom_ref |
507 |
| - } |
508 |
| - entity = OrganizationalEntity.from_json(specification) |
509 |
| - assert entity.name == name |
510 |
| - assert entity.urls == SortedSet([XsUri(url) for url in urls]) |
511 |
| - assert entity.bom_ref == BomRef(bom_ref) |
512 |
| - assert len(entity.urls) == 1 |
513 |
| - assert next(iter(entity.urls)) == XsUri(urls[0]) |
514 |
| - |
515 |
| - def test_init_from_json_without_url(self) -> None: |
516 |
| - bom_ref = 'Example' |
517 |
| - name = 'Example' |
518 |
| - specification = { |
519 |
| - 'name': name, |
520 |
| - 'bom-ref': bom_ref |
521 |
| - } |
522 |
| - entity = OrganizationalEntity.from_json(specification) |
523 |
| - assert entity.name == name |
524 |
| - assert entity.urls == SortedSet() |
525 |
| - assert entity.bom_ref == BomRef(bom_ref) |
526 |
| - |
527 |
| - |
528 | 466 | class TestModelXsUri(TestCase):
|
529 | 467 |
|
530 | 468 | # URI samples taken from http://www.datypic.com/sc/xsd/t-xsd_anyURI.html
|
|
0 commit comments