[tests] rename factory test and move bag detecting so any bag is returned as is as an output.
This commit is contained in:
@ -9,7 +9,7 @@ from bonobo.execution.base import LoopingExecutionContext
|
|||||||
from bonobo.structs.bags import Bag
|
from bonobo.structs.bags import Bag
|
||||||
from bonobo.structs.inputs import Input
|
from bonobo.structs.inputs import Input
|
||||||
from bonobo.structs.tokens import Token
|
from bonobo.structs.tokens import Token
|
||||||
from bonobo.util import get_name, iserrorbag, isloopbackbag
|
from bonobo.util import get_name, iserrorbag, isloopbackbag, isbag
|
||||||
from bonobo.util.compat import deprecated_alias
|
from bonobo.util.compat import deprecated_alias
|
||||||
from bonobo.util.statistics import WithStatistics
|
from bonobo.util.statistics import WithStatistics
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ def _resolve(input_bag, output):
|
|||||||
if output is NOT_MODIFIED:
|
if output is NOT_MODIFIED:
|
||||||
return input_bag
|
return input_bag
|
||||||
|
|
||||||
if iserrorbag(output):
|
if isbag(output):
|
||||||
return output
|
return output
|
||||||
|
|
||||||
return Bag(output)
|
return Bag(output)
|
||||||
|
|||||||
@ -11,7 +11,7 @@ from bonobo.util.testing import BufferingNodeExecutionContext
|
|||||||
class FactoryTypeTest(TestCase):
|
class FactoryTypeTest(TestCase):
|
||||||
def execute_node(self, node, *rows):
|
def execute_node(self, node, *rows):
|
||||||
with BufferingNodeExecutionContext(node) as context:
|
with BufferingNodeExecutionContext(node) as context:
|
||||||
context.write_sync(*map(Bag, rows))
|
context.write_sync(*rows)
|
||||||
return context.get_buffer()
|
return context.get_buffer()
|
||||||
|
|
||||||
def test_args_as_str(self):
|
def test_args_as_str(self):
|
||||||
Reference in New Issue
Block a user