From 73e01b347b2fb980f926fba08a22277004d51a45 Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Tue, 24 Nov 2020 16:51:18 -0500 Subject: [PATCH] Ticket #105. Verify End Event Documentation. Added explicit call to _process_documentation at end of crc.services.workflow_service.test_spec for the end event --- crc/services/workflow_service.py | 1 + .../verify_end_event/verify_end_event.bpmn | 24 +++++++++---------- tests/test_verify_end_event.py | 18 ++++++++++++++ 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/crc/services/workflow_service.py b/crc/services/workflow_service.py index 6d9eed5b..9808766c 100644 --- a/crc/services/workflow_service.py +++ b/crc/services/workflow_service.py @@ -116,6 +116,7 @@ class WorkflowService(object): raise ApiError.from_workflow_exception("workflow_validation_exception", str(we), we) WorkflowService.delete_test_data() + WorkflowService._process_documentation(processor.bpmn_workflow.last_task.parent.parent) return processor.bpmn_workflow.last_task.data @staticmethod diff --git a/tests/data/verify_end_event/verify_end_event.bpmn b/tests/data/verify_end_event/verify_end_event.bpmn index 2f23b93c..b741d8e8 100644 --- a/tests/data/verify_end_event/verify_end_event.bpmn +++ b/tests/data/verify_end_event/verify_end_event.bpmn @@ -1,5 +1,5 @@ - + @@ -70,29 +70,29 @@ Question not presented - - + + - - + + - - + + - + - + - + - + - \ No newline at end of file + diff --git a/tests/test_verify_end_event.py b/tests/test_verify_end_event.py index e69de29b..18069f99 100644 --- a/tests/test_verify_end_event.py +++ b/tests/test_verify_end_event.py @@ -0,0 +1,18 @@ +from tests.base_test import BaseTest +from crc.services.workflow_service import WorkflowService +from crc.api.common import ApiError +from jinja2.exceptions import TemplateSyntaxError + + +class TestValidateEndEvent(BaseTest): + + def test_validate_end_event(self): + + error_string = """Error processing template for task EndEvent_1qvyxg7: expected token 'end of statement block', got '='""" + + self.load_example_data() + spec_model = self.load_test_spec('verify_end_event') + try: + WorkflowService.test_spec(spec_model.id) + except ApiError as e: + self.assertEqual(str(e), error_string)