diff --git a/diagrams/c4/__init__.py b/diagrams/c4/__init__.py index 31973627..eda0ddd7 100644 --- a/diagrams/c4/__init__.py +++ b/diagrams/c4/__init__.py @@ -121,7 +121,7 @@ def SystemBoundary(name, **kwargs): return Cluster(name, graph_attr=graph_attributes) -def Dependency(label="", **kwargs): +def Relationship(label="", **kwargs): edge_attribtues = {"style": "dashed", "color": "gray60"} if label: edge_attribtues.update({"label": _format_edge_label(label)}) diff --git a/tests/test_c4.py b/tests/test_c4.py index 66f25b9f..25c85455 100644 --- a/tests/test_c4.py +++ b/tests/test_c4.py @@ -5,7 +5,7 @@ import unittest from diagrams import Diagram from diagrams import setcluster, setdiagram -from diagrams.c4 import Person, Container, Database, System, SystemBoundary, Dependency +from diagrams.c4 import Person, Container, Database, System, SystemBoundary, Relationship class C4Test(unittest.TestCase): @@ -26,8 +26,6 @@ class C4Test(unittest.TestCase): container = Container("container", "Java application", "The application.") database = Database("database", "Oracle database", "Stores information.") - person >> container >> database - def test_external_nodes(self): with Diagram(name=self.name, show=False): external_person = Person("person", external=True) @@ -38,22 +36,27 @@ class C4Test(unittest.TestCase): system = System("system", "The internal system.") system_without_description = System("unknown") - system >> system_without_description >> external_system - def test_edges(self): with Diagram(name=self.name, show=False): - c1 = Container("container1", "type", "description") - c2 = Container("container2", "type", "description") + c1 = Container("container1") + c2 = Container("container2") + + c1 >> c2 + + def test_edges_with_labels(self): + with Diagram(name=self.name, show=False): + c1 = Container("container1") + c2 = Container("container2") - c1 >> Dependency("depends on") >> c2 - c1 << Dependency("is dependend on") << c2 + c1 >> Relationship("depends on") >> c2 + c1 << Relationship("is depended on by") << c2 def test_edge_without_constraint(self): with Diagram(name=self.name, show=False): s1 = System("system 1") s2 = System("system 2") - s1 >> Dependency(constraint="False") >> s2 + s1 >> Relationship(constraint="False") >> s2 def test_cluster(self): with Diagram(name=self.name, show=False):