From 5e25e591ae8acc8d3f06ba8f097dbda2f878c422 Mon Sep 17 00:00:00 2001 From: jasquat Date: Tue, 23 May 2023 15:55:27 -0400 Subject: [PATCH] pyl w/ burnettk --- .../services/process_model_test_runner_service.py | 8 +++++--- .../unit/test_process_model_test_runner.py | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_test_runner_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_test_runner_service.py index fc683ff56..db5a0d449 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_test_runner_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_test_runner_service.py @@ -1,6 +1,5 @@ import glob import json -from typing import Union import os import re import traceback @@ -8,6 +7,7 @@ from dataclasses import dataclass from typing import Any from typing import Callable from typing import Optional +from typing import Union from lxml import etree # type: ignore from SpiffWorkflow.bpmn.exceptions import WorkflowTaskException # type: ignore @@ -103,7 +103,7 @@ class ProcessModelTestRunner: process_model_directory_path: str, process_model_directory_for_test_discovery: Optional[str] = None, instantiate_executer_callback: Optional[Callable[[str], Any]] = None, - execute_task_callback: Optional[Callable[[Any, str, Optional[dict]], Any]] = None, + execute_task_callback: Optional[Callable[[Any, Optional[str], Optional[dict]], Any]] = None, get_next_task_callback: Optional[Callable[[Any], Any]] = None, test_case_file: Optional[str] = None, test_case_identifier: Optional[str] = None, @@ -343,7 +343,9 @@ class ProcessModelTestRunner: def _get_relative_path_of_bpmn_file(self, bpmn_file: str) -> str: return os.path.relpath(bpmn_file, start=self.process_model_directory_path) - def _exception_to_test_case_error_details(self, exception: Union[Exception, WorkflowTaskException]) -> TestCaseErrorDetails: + def _exception_to_test_case_error_details( + self, exception: Union[Exception, WorkflowTaskException] + ) -> TestCaseErrorDetails: error_messages = str(exception).split("\n") test_case_error_details = TestCaseErrorDetails(error_messages=error_messages) if isinstance(exception, WorkflowTaskException): diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_model_test_runner.py b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_model_test_runner.py index bdf8633a7..78e6b2e1e 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_model_test_runner.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_model_test_runner.py @@ -1,5 +1,4 @@ import os -# from typing import Any from typing import Optional import pytest