mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-01-15 20:14:56 +00:00
0892db6fa7
git-subtree-dir: SpiffWorkflow git-subtree-split: 63db3e45947ec66b8d0efc2c74064004f8ff482c
30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
import unittest
|
|
import os
|
|
|
|
from SpiffWorkflow.bpmn.parser.BpmnParser import BpmnParser
|
|
|
|
|
|
class ParserTest(unittest.TestCase):
|
|
|
|
def testIOSpecification(self):
|
|
|
|
parser = BpmnParser()
|
|
bpmn_file = os.path.join(os.path.dirname(__file__), 'data', 'io_spec.bpmn')
|
|
parser.add_bpmn_file(bpmn_file)
|
|
spec = parser.get_spec('subprocess')
|
|
self.assertEqual(len(spec.data_inputs), 2)
|
|
self.assertEqual(len(spec.data_outputs), 2)
|
|
|
|
def testDataReferences(self):
|
|
|
|
parser = BpmnParser()
|
|
bpmn_file = os.path.join(os.path.dirname(__file__), 'data', 'data_object.bpmn')
|
|
parser.add_bpmn_file(bpmn_file)
|
|
spec = parser.get_spec("Process")
|
|
generate = spec.task_specs['generate_data']
|
|
read = spec.task_specs['read_data']
|
|
self.assertEqual(len(generate.data_output_associations), 1)
|
|
self.assertEqual(generate.data_output_associations[0].name, 'obj_1')
|
|
self.assertEqual(len(read.data_input_associations), 1)
|
|
self.assertEqual(read.data_input_associations[0].name, 'obj_1')
|