constants

This commit is contained in:
Romain Dorgueil
2016-12-26 13:55:59 +01:00
parent 39cfd72761
commit 4bc6248ee4
10 changed files with 47 additions and 47 deletions

View File

@ -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')