From 47ff29e3ab9b85fd2f6d43d7e9490db39e224b23 Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Thu, 18 Mar 2021 12:25:27 -0400 Subject: [PATCH] Added a test for dictionary output from a decision table. Will need dictionary output for master workflow status messages. --- .../decision_table_dictionary_output.bpmn | 71 +++++++++++++++++++ .../decision_table_dictionary_output.dmn | 69 ++++++++++++++++++ .../test_decision_table_dictionary_output.py | 15 ++++ 3 files changed, 155 insertions(+) create mode 100644 tests/data/decision_table_dictionary_output/decision_table_dictionary_output.bpmn create mode 100644 tests/data/decision_table_dictionary_output/decision_table_dictionary_output.dmn create mode 100644 tests/test_decision_table_dictionary_output.py diff --git a/tests/data/decision_table_dictionary_output/decision_table_dictionary_output.bpmn b/tests/data/decision_table_dictionary_output/decision_table_dictionary_output.bpmn new file mode 100644 index 00000000..1117386f --- /dev/null +++ b/tests/data/decision_table_dictionary_output/decision_table_dictionary_output.bpmn @@ -0,0 +1,71 @@ + + + + Testing Workflow Status Messages + + SequenceFlow_0x4n744 + + + + + SequenceFlow_1o630oy + SequenceFlow_1foyag7 + + + + <div><span>Good Bye {{ dog.name }}</span></div> +<div><span>You are such a good {{ dog.breed }}</span></div> + + SequenceFlow_1foyag7 + SequenceFlow_1bc1ugw + + + SequenceFlow_1bc1ugw + + + + + + + + + SequenceFlow_0x4n744 + SequenceFlow_1o630oy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/data/decision_table_dictionary_output/decision_table_dictionary_output.dmn b/tests/data/decision_table_dictionary_output/decision_table_dictionary_output.dmn new file mode 100644 index 00000000..3f74accf --- /dev/null +++ b/tests/data/decision_table_dictionary_output/decision_table_dictionary_output.dmn @@ -0,0 +1,69 @@ + + + + + + + name + + + + + + + 'Layla' + + + 'Layla' + + + 'Aussie' + + + + + 'Mona' + + + 'Mona' + + + 'Aussie Mix' + + + + + 'Jerry' + + + 'Jerry' + + + 'Aussie Mix' + + + + + 'Zoey' + + + 'Zoey' + + + 'Healer' + + + + + 'Etta' + + + 'Etta' + + + 'Healer Mix' + + + + + diff --git a/tests/test_decision_table_dictionary_output.py b/tests/test_decision_table_dictionary_output.py new file mode 100644 index 00000000..a516825a --- /dev/null +++ b/tests/test_decision_table_dictionary_output.py @@ -0,0 +1,15 @@ +from tests.base_test import BaseTest + + +class TestDecisionTableDictionaryOutput(BaseTest): + + def test_decision_table_dictionary_output(self): + + workflow = self.create_workflow('decision_table_dictionary_output') + workflow_api = self.get_workflow_api(workflow) + first_task = workflow_api.next_task + + result = self.complete_form(workflow, first_task, {'name': 'Mona'}) + self.assertIn('dog', result.next_task.data) + self.assertEqual('Mona', result.next_task.data['dog']['name']) + self.assertEqual('Aussie Mix', result.next_task.data['dog']['breed'])