feat: new alternate syntax and switch to black + isort (yeah, maybe not the best time, but that is done).
This commit is contained in:
@ -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))
|
||||
|
||||
@ -7,10 +7,7 @@ def useless(*args, **kwargs):
|
||||
|
||||
|
||||
def test_not_modified():
|
||||
input_messages = [
|
||||
('foo', 'bar'),
|
||||
('foo', 'baz'),
|
||||
]
|
||||
input_messages = [("foo", "bar"), ("foo", "baz")]
|
||||
|
||||
with BufferingNodeExecutionContext(useless) as context:
|
||||
context.write_sync(*input_messages)
|
||||
|
||||
Reference in New Issue
Block a user