Commit 6663d72c authored by payno's avatar payno
Browse files

update unit test since out contains the channel used

parent 7c2f242d
Pipeline #31661 passed with stages
in 33 seconds
......@@ -55,10 +55,7 @@ class MyCallable(object):
class MyObject(object):
"""Simple object with handler"""
inputs = [
("mydata", dict, "handler_1"),
("mydata2", dict, "handler_2"),
]
inputs = [("mydata", dict, "handler_1"), ("mydata2", dict, "handler_2")]
def handler_1(self, input_):
input_.update({"called": True})
......@@ -82,20 +79,20 @@ class TestHandlers(unittest.TestCase):
node.load_handlers()
self.assertEqual(len(node.handlers), 1)
self.assertTrue(node.handlers[None] == mycallback)
my_scheme = Scheme(nodes=[node,])
my_scheme = Scheme(nodes=[node])
processable_scheme = ProcessableScheme(scheme=my_scheme)
out_ = exec_(scheme=processable_scheme)
self.assertTrue("called" in out_)
self.assertEqual((None, {"called": True}), out_)
def test_nodes_callable_obj(self):
"""simple scheme with two nodes. Callback is a callable object"""
node = Node(processing_pt=".".join((__file__, "MyCallable")))
node.load_handlers()
self.assertEqual(len(node.handlers), 1)
my_scheme = Scheme(nodes=[node,])
my_scheme = Scheme(nodes=[node])
processable_scheme = ProcessableScheme(scheme=my_scheme)
out_ = exec_(scheme=processable_scheme)
self.assertTrue("called" in out_)
self.assertEqual((None, {"called": True}), out_)
# def test_nodes_obj_handler_function(self):
# """simple scheme with two nodes. Callback is a specific function of an
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment