spiff-arena/tests/SpiffWorkflow/bpmn/ParallelMultipleSplitsTest.py
Jon Herron 0892db6fa7 Squashed 'SpiffWorkflow/' content from commit 63db3e4
git-subtree-dir: SpiffWorkflow
git-subtree-split: 63db3e45947ec66b8d0efc2c74064004f8ff482c
2022-10-12 10:19:53 -04:00

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())