spiff-arena/tests/SpiffWorkflow/bpmn/NestedProcessesTest.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

37 lines
1.2 KiB
Python

import unittest
from SpiffWorkflow.task import TaskState
from SpiffWorkflow.bpmn.workflow import BpmnWorkflow
from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase
__author__ = 'neilc'
class NestedProcessesTest(BpmnWorkflowTestCase):
def setUp(self):
spec, subprocesses = self.load_workflow_spec('Test-Workflows/Nested*.bpmn20.xml', 'Nested Subprocesses')
self.workflow = BpmnWorkflow(spec, subprocesses)
def testRunThroughHappy(self):
self.do_next_named_step('Action1')
self.workflow.do_engine_steps()
self.save_restore()
self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY)))
self.do_next_named_step('Action2')
self.workflow.do_engine_steps()
self.save_restore()
self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY)))
self.do_next_named_step('Action3')
self.workflow.do_engine_steps()
self.save_restore()
self.assertEqual(
0, len(self.workflow.get_tasks(TaskState.READY | TaskState.WAITING)))
def suite():
return unittest.TestLoader().loadTestsFromTestCase(NestedProcessesTest)
if __name__ == '__main__':
unittest.TextTestRunner(verbosity=2).run(suite())