Commit 5333a99a authored by payno's avatar payno
Browse files

[CI] update unit test since manage channels

parent 18d280ff
...@@ -79,28 +79,28 @@ class TestNodeExecution(unittest.TestCase): ...@@ -79,28 +79,28 @@ class TestNodeExecution(unittest.TestCase):
node = Node(processing_pt='pypushflow.test.utils.test_function') node = Node(processing_pt='pypushflow.test.utils.test_function')
res = node.execute(node.process_pt, properties={}, input_name='data', res = node.execute(node.process_pt, properties={}, input_name='data',
input_data={'data': 0}) input_data={'data': 0})
self.assertEqual(res, {'data': 2}) self.assertEqual(res, (None, {'data': 2}))
def testCase2(self): def testCase2(self):
'test that an callable class can be executed from her name' 'test that an callable class can be executed from her name'
node = Node(processing_pt='pypushflow.test.utils.ProcessingClass1') node = Node(processing_pt='pypushflow.test.utils.ProcessingClass1')
res = node.execute(node.process_pt, properties={}, input_name='data', res = node.execute(node.process_pt, properties={}, input_name='data',
input_data={'data': 0}) input_data={'data': 0})
self.assertEqual(res, {'data': 4}) self.assertEqual(res, (None, {'data': 4}))
def testCase3(self): def testCase3(self):
"""Test that a class with handler can be executed""" """Test that a class with handler can be executed"""
node = Node(processing_pt='pypushflow.test.utils.ProcessingClass2') node = Node(processing_pt='pypushflow.test.utils.ProcessingClass2')
res = node.execute(node.process_pt, properties={}, input_name='data', res = node.execute(node.process_pt, properties={}, input_name='data',
input_data={'data': 0}) input_data={'data': 0})
self.assertEqual(res, {'data': 1}) self.assertEqual(res, (None, {'data': 1}))
def testCase4(self): def testCase4(self):
script = 'pypushflow.test.pythonActorTest.run' script = 'pypushflow.test.pythonActorTest.run'
node = Node(processing_pt=script) node = Node(processing_pt=script)
res = node.execute(node.process_pt, properties={}, input_name='data', res = node.execute(node.process_pt, properties={}, input_name='data',
input_data={'name': 'pythonActorTest'}) input_data={'name': 'pythonActorTest'})
self.assertEqual(res, {'reply': 'Hello pythonActorTest!'}) self.assertEqual(res, (None, {'reply': 'Hello pythonActorTest!'}))
def suite(): def suite():
......
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