Skip to content

Commit 521b531

Browse files
yt-msMidnighter
authored andcommitted
refactor: make technology optional in SoftwareSystem.add_container.
This makes it consistent with the constructor of Container (as well as easier to use).
1 parent 1cbf222 commit 521b531

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/unit/model/test_software_system.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
from structurizr.model.software_system import SoftwareSystem
2323

2424

25+
@pytest.fixture(scope="function")
26+
def empty_model() -> Model:
27+
"""Provide an empty Model on demand for test cases to use."""
28+
return Model()
29+
30+
2531
@pytest.mark.parametrize(
2632
"attributes",
2733
[
@@ -42,3 +48,9 @@ def test_add_container_accepts_additional_args():
4248
system = model.add_software_system(name="Banking System")
4349
container = system.add_container("container", "description", id="id1")
4450
assert container.id == "id1"
51+
52+
53+
def test_add_container_technology_is_optional(empty_model: Model):
54+
system = empty_model.add_software_system(name="sys")
55+
container = system.add_container(name="Container", description="Description")
56+
assert container.technology == ""

0 commit comments

Comments
 (0)