work in progress: working on nodes lifecycle.

This commit is contained in:
Romain Dorgueil
2018-07-22 07:34:11 +02:00
parent 6a1203602f
commit 66451d03bb
12 changed files with 74 additions and 65 deletions

View File

@ -1,4 +1,5 @@
from bonobo import Graph
from bonobo.constants import EMPTY, BEGIN, END
from bonobo.execution.contexts import GraphExecutionContext
@ -49,9 +50,8 @@ def test_lifecycle_of_graph_with_recoverable_error():
def test_lifecycle_of_graph_with_unrecoverable_error():
graph = Graph([1, 2, 3], raise_an_unrecoverrable_error, print)
with GraphExecutionContext(graph) as context:
assert context.started
assert context.alive
assert not context.stopped
assert context.started and context.alive and not context.stopped
context.write(BEGIN, EMPTY, END)
context.loop()
assert context.started
assert not context.alive