We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54cf48f commit 3c9f234Copy full SHA for 3c9f234
tests/test_model.py
@@ -509,6 +509,20 @@ def test_init_from_json(self) -> None:
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
class TestModelXsUri(TestCase):
0 commit comments