plesna/tests/graphs/test_graph.py

17 lines
392 B
Python
Raw Normal View History

2024-10-07 04:17:01 +00:00
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}