mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-01-16 04:24:20 +00:00
c237e218b2
0e61be85 Merge pull request #289 from sartography/improvement/execution-and-serialization-cleanup 527684da fix some typos in the class & method docs 0dff44a4 Merge branch 'main' into improvement/execution-and-serialization-cleanup 64737498 Allow for other PythonScriptEngine environments besides task data (#288) dd63e916 remove some unused tests & diagrams 24aae519 clean up various small stuff 3b2dc35d use context when opening files for parsing 69eec3eb update class/method docs 24528dfb move all spec conversion classes to top level 5af33b11 remove some unused methods related to old serializer 931b90fb reorganize serializer 4e81ed29 consolidate pointless serializer classes d62acf02 change task_spec._update_hook to return a boolean indicating whether the task is ready git-subtree-dir: SpiffWorkflow git-subtree-split: 0e61be85c47474a33037e6f398e64c96e02f13ad
27 lines
1.1 KiB
Python
27 lines
1.1 KiB
Python
import unittest
|
|
import os
|
|
|
|
from SpiffWorkflow.bpmn.workflow import BpmnWorkflow
|
|
from SpiffWorkflow.bpmn.parser.BpmnParser import BpmnParser
|
|
from SpiffWorkflow.bpmn.serializer.workflow import BpmnWorkflowSerializer
|
|
|
|
|
|
class BaseTestCase(unittest.TestCase):
|
|
|
|
SERIALIZER_VERSION = "100.1.ANY"
|
|
DATA_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data')
|
|
|
|
def load_workflow_spec(self, filename, process_name):
|
|
parser = BpmnParser()
|
|
parser.add_bpmn_files_by_glob(os.path.join(self.DATA_DIR, filename))
|
|
top_level_spec = parser.get_spec(process_name)
|
|
subprocesses = parser.get_subprocess_specs(process_name)
|
|
return top_level_spec, subprocesses
|
|
|
|
def setUp(self):
|
|
super(BaseTestCase, self).setUp()
|
|
wf_spec_converter = BpmnWorkflowSerializer.configure_workflow_spec_converter()
|
|
self.serializer = BpmnWorkflowSerializer(wf_spec_converter, version=self.SERIALIZER_VERSION)
|
|
spec, subprocesses = self.load_workflow_spec('random_fact.bpmn', 'random_fact')
|
|
self.workflow = BpmnWorkflow(spec, subprocesses)
|