Feat: add pure graph

This commit is contained in:
2024-10-07 06:17:01 +02:00
parent c90f407cfc
commit 5c69bb5503
2 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
from plesna.graph import Edge, Graph, Node
def test_init():
nodeA = Node(name="A")
nodeB = Node(name="B")
nodeC = Node(name="C")
edge1 = Edge(arrow_name="arrow", source=nodeA, target=nodeC)
edge2 = Edge(arrow_name="arrow", source=nodeB, target=nodeC)
graph = Graph()
graph.append(edge1)
graph.append(edge2)
assert graph.nodes == {nodeA, nodeB, nodeC}