Commit 80f6eea6 authored by payno's avatar payno
Browse files

[ci][TestNodeExecution] add a case to manage Node from script name which contains a run function.

Add also some documentation
parent 030ee583
......@@ -75,23 +75,33 @@ class TestScheme(unittest.TestCase):
class TestNodeExecution(unittest.TestCase):
"""Insure Node.execute works"""
def testCase1(self):
'test that a specific function from her name can be executed'
node = Node(processing_pt='pypushflow.test.utils.test_function')
res = node.execute(node.process_pt, properties={}, input_name='data',
input_data={'data': 0})
self.assertEqual(res, {'data': 2})
def testCase2(self):
'test that an callable class can be executed from her name'
node = Node(processing_pt='pypushflow.test.utils.ProcessingClass1')
res = node.execute(node.process_pt, properties={}, input_name='data',
input_data={'data': 0})
self.assertEqual(res, {'data': 4})
def testCase3(self):
"""Test that a class with handler can be executed"""
node = Node(processing_pt='pypushflow.test.utils.ProcessingClass2')
res = node.execute(node.process_pt, properties={}, input_name='data',
input_data={'data': 0})
self.assertEqual(res, {'data': 1})
def testCase4(self):
script = 'pypushflow.test.pythonActorTest.run'
node = Node(processing_pt=script)
res = node.execute(node.process_pt, properties={}, input_name='data',
input_data='pythonActorTest')
self.assertEqual(res, {'reply': 'Hello pythonActorTest!'})
def suite():
test_suite = unittest.TestSuite()
......
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