mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-01-09 17:55:48 +00:00
0892db6fa7
git-subtree-dir: SpiffWorkflow git-subtree-split: 63db3e45947ec66b8d0efc2c74064004f8ff482c
52 lines
1.7 KiB
Python
52 lines
1.7 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
import unittest
|
|
|
|
from SpiffWorkflow.bpmn.workflow import BpmnWorkflow
|
|
from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase
|
|
|
|
__author__ = 'matth'
|
|
|
|
|
|
class SubWorkflowMultiTest(BpmnWorkflowTestCase):
|
|
|
|
expected_data = {
|
|
'a': {'name': 'Apple_edit',
|
|
'new_info': 'Adding this!'},
|
|
'b': {'name': 'Bubble_edit',
|
|
'new_info': 'Adding this!'},
|
|
'c': {'name': 'Crap, I should write better code_edit',
|
|
'new_info': 'Adding this!'}
|
|
}
|
|
|
|
def testSequential(self):
|
|
spec, subprocesses = self.load_workflow_spec('sub_workflow_multi.bpmn', 'ScriptTest')
|
|
self.workflow = BpmnWorkflow(spec, subprocesses)
|
|
self.workflow.do_engine_steps()
|
|
|
|
data = self.workflow.last_task.data
|
|
self.assertEqual(data['my_collection'], self.expected_data)
|
|
|
|
def testParallel(self):
|
|
spec, subprocesses= self.load_workflow_spec('sub_workflow_multi_parallel.bpmn', 'ScriptTest')
|
|
self.workflow = BpmnWorkflow(spec, subprocesses)
|
|
self.workflow.do_engine_steps()
|
|
|
|
data = self.workflow.last_task.data
|
|
self.assertEqual(data['my_collection'], self.expected_data)
|
|
|
|
def testWrapped(self):
|
|
spec, subprocesses = self.load_workflow_spec('sub_within_sub_multi.bpmn', 'ScriptTest')
|
|
self.workflow = BpmnWorkflow(spec, subprocesses)
|
|
self.workflow.do_engine_steps()
|
|
|
|
data = self.workflow.last_task.data
|
|
self.assertEqual(self.expected_data, data['my_collection'])
|
|
|
|
|
|
|
|
def suite():
|
|
return unittest.TestLoader().loadTestsFromTestCase(SubWorkflowMultiTest)
|
|
if __name__ == '__main__':
|
|
unittest.TextTestRunner(verbosity=2).run(suite())
|