19 lines
507 B
Python
19 lines
507 B
Python
|
from plesna.graph_set import EdgeOnSet, GraphSet, Node
|
||
|
|
||
|
|
||
|
def test_init():
|
||
|
nodeA = Node(name="A")
|
||
|
nodeB = Node(name="B")
|
||
|
nodeC = Node(name="C")
|
||
|
|
||
|
def arrow(sources, targets):
|
||
|
targets["C"].infos["res"] = sources["A"].name + sources["B"].name
|
||
|
|
||
|
edge1 = EdgeOnSet(
|
||
|
arrow=arrow, sources={"A": nodeA, "B": nodeB}, targets={"C": nodeC}
|
||
|
)
|
||
|
graph_set = GraphSet()
|
||
|
graph_set.append(edge1)
|
||
|
|
||
|
assert graph_set.node_sets == {frozenset([nodeA, nodeB]), frozenset([nodeC])}
|