feat: new alternate syntax and switch to black + isort (yeah, maybe not the best time, but that is done).

This commit is contained in:
Romain Dorgueil
2018-07-29 18:21:56 +01:00
parent 3094e43f9f
commit 89dda0dca6
123 changed files with 1672 additions and 1640 deletions

View File

@ -1,27 +1,24 @@
from bonobo.util.envelopes import AppendingEnvelope
from bonobo.util.testing import BufferingNodeExecutionContext
messages = [
('Hello', ),
('Goodbye', ),
]
messages = [("Hello",), ("Goodbye",)]
def append(*args):
return AppendingEnvelope('!')
return AppendingEnvelope("!")
def test_inherit():
with BufferingNodeExecutionContext(append) as context:
context.write_sync(*messages)
assert context.get_buffer() == list(map(lambda x: x + ('!', ), messages))
assert context.get_buffer() == list(map(lambda x: x + ("!",), messages))
def test_inherit_bag_tuple():
with BufferingNodeExecutionContext(append) as context:
context.set_input_fields(['message'])
context.set_input_fields(["message"])
context.write_sync(*messages)
assert context.get_output_fields() == ('message', '0')
assert context.get_buffer() == list(map(lambda x: x + ('!', ), messages))
assert context.get_output_fields() == ("message", "0")
assert context.get_buffer() == list(map(lambda x: x + ("!",), messages))