constants
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
from mock import Mock
|
||||
|
||||
from bonobo import Bag
|
||||
from bonobo.core.bags import InheritInputFlag
|
||||
from bonobo.core.bags import INHERIT_INPUT
|
||||
|
||||
args = (
|
||||
'foo',
|
||||
@ -42,7 +42,7 @@ def test_inherit():
|
||||
'a',
|
||||
'b', )
|
||||
assert bag2.kwargs == {'a': 1, 'b': 2}
|
||||
assert InheritInputFlag in bag2.flags
|
||||
assert INHERIT_INPUT in bag2.flags
|
||||
|
||||
assert bag3.args == (
|
||||
'a',
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from bonobo.core.graphs import Graph
|
||||
from bonobo.util.tokens import Begin
|
||||
from bonobo.util.tokens import BEGIN
|
||||
|
||||
identity = lambda x: x
|
||||
|
||||
@ -10,7 +10,7 @@ def test_graph_outputs_of():
|
||||
g = Graph()
|
||||
|
||||
# default graph only node
|
||||
assert len(g.outputs_of(Begin)) == 0
|
||||
assert len(g.outputs_of(BEGIN)) == 0
|
||||
|
||||
# unexisting node
|
||||
with pytest.raises(KeyError):
|
||||
@ -40,4 +40,4 @@ def test_graph_add_chain():
|
||||
|
||||
g.add_chain(identity, identity, identity)
|
||||
assert len(g.components) == 3
|
||||
assert len(g.outputs_of(Begin)) == 1
|
||||
assert len(g.outputs_of(BEGIN)) == 1
|
||||
|
||||
@ -20,7 +20,7 @@ import pytest
|
||||
|
||||
from bonobo.core.errors import InactiveWritableError, InactiveReadableError
|
||||
from bonobo.core.inputs import Input
|
||||
from bonobo.util.tokens import Begin, End
|
||||
from bonobo.util.tokens import BEGIN, END
|
||||
|
||||
|
||||
def test_input_runlevels():
|
||||
@ -32,15 +32,15 @@ def test_input_runlevels():
|
||||
q.put('hello, unborn queue.')
|
||||
|
||||
# Begin
|
||||
q.put(Begin)
|
||||
q.put(BEGIN)
|
||||
assert q.alive and q._runlevel == 1
|
||||
q.put('foo')
|
||||
|
||||
# Second Begin
|
||||
q.put(Begin)
|
||||
q.put(BEGIN)
|
||||
assert q.alive and q._runlevel == 2
|
||||
q.put('bar')
|
||||
q.put(End)
|
||||
q.put(END)
|
||||
|
||||
# FIFO
|
||||
assert q.get() == 'foo'
|
||||
@ -56,7 +56,7 @@ def test_input_runlevels():
|
||||
q.put('baz')
|
||||
|
||||
# Now kill the queue...
|
||||
q.put(End)
|
||||
q.put(END)
|
||||
with pytest.raises(InactiveWritableError):
|
||||
q.put('foo')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user