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
47 lines
1.7 KiB
Python
47 lines
1.7 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
import unittest
|
|
from SpiffWorkflow.task import TaskState
|
|
from SpiffWorkflow.bpmn.workflow import BpmnWorkflow
|
|
from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase
|
|
|
|
__author__ = 'matth'
|
|
|
|
class ParallelMultipleSplitsTest(BpmnWorkflowTestCase):
|
|
|
|
def setUp(self):
|
|
spec, subprocesses = self.load_workflow_spec('Test-Workflows/Parallel-Multiple-Splits.bpmn20.xml', 'Parallel Multiple Splits')
|
|
self.workflow = BpmnWorkflow(spec, subprocesses)
|
|
self.workflow.do_engine_steps()
|
|
|
|
def testRunThroughAlternating(self):
|
|
|
|
self.assertEqual(2, len(self.workflow.get_tasks(TaskState.READY)))
|
|
|
|
self.do_next_named_step('Do First')
|
|
self.workflow.do_engine_steps()
|
|
self.do_next_named_step('SP 1 - Choose', choice='Yes')
|
|
self.workflow.do_engine_steps()
|
|
self.do_next_named_step('SP 2 - Choose', choice='Yes')
|
|
self.workflow.do_engine_steps()
|
|
self.do_next_named_step('SP 3 - Choose', choice='Yes')
|
|
self.workflow.do_engine_steps()
|
|
self.do_next_named_step('SP 1 - Yes Task')
|
|
self.workflow.do_engine_steps()
|
|
self.do_next_named_step('SP 2 - Yes Task')
|
|
self.workflow.do_engine_steps()
|
|
self.do_next_named_step('SP 3 - Yes Task')
|
|
self.workflow.do_engine_steps()
|
|
|
|
self.do_next_named_step('Done')
|
|
self.workflow.do_engine_steps()
|
|
|
|
self.assertEqual(
|
|
0, len(self.workflow.get_tasks(TaskState.READY | TaskState.WAITING)))
|
|
|
|
|
|
def suite():
|
|
return unittest.TestLoader().loadTestsFromTestCase(ParallelMultipleSplitsTest)
|
|
if __name__ == '__main__':
|
|
unittest.TextTestRunner(verbosity=2).run(suite())
|