Adds simple test for #326.
This commit is contained in:
@ -297,6 +297,14 @@ def get_pseudo_nodes(*names):
|
||||
|
||||
>>> a, b, c = get_pseudo_nodes(*"abc")
|
||||
|
||||
Alternate syntax:
|
||||
|
||||
>>> a, b, c = get_pseudo_nodes(3)
|
||||
|
||||
"""
|
||||
if len(names) == 1 and isinstance(names[0], int):
|
||||
yield from get_pseudo_nodes(*map(chr, range(ord("a"), ord("a") + names[0])))
|
||||
return
|
||||
|
||||
for name in names:
|
||||
yield getattr(sentinel, name)
|
||||
|
||||
@ -140,3 +140,21 @@ def test_cursor_merge_orphan_in_between():
|
||||
assert g.outputs_of(w) == g.indexes_of(b)
|
||||
assert g.outputs_of(x) == g.indexes_of(y)
|
||||
assert g.outputs_of(y) == g.indexes_of(b)
|
||||
|
||||
|
||||
def test_using_same_cursor_many_times_for_fork():
|
||||
a, b, c, d, e = get_pseudo_nodes(5)
|
||||
g = Graph()
|
||||
|
||||
c0 = g >> a >> b
|
||||
|
||||
c0 >> c
|
||||
c0 >> d
|
||||
c0 >> e
|
||||
|
||||
assert g.outputs_of(BEGIN) == g.indexes_of(a)
|
||||
assert g.outputs_of(a) == g.indexes_of(b)
|
||||
assert g.outputs_of(b) == g.indexes_of(c, d, e)
|
||||
assert g.outputs_of(c) == set()
|
||||
assert g.outputs_of(d) == set()
|
||||
assert g.outputs_of(e) == set()
|
||||
|
||||
Reference in New Issue
Block a user