pyl w/ burnettk

This commit is contained in:
jasquat 2023-05-23 15:55:27 -04:00
parent ac73ee47f6
commit 5e25e591ae
2 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,5 @@
import glob import glob
import json import json
from typing import Union
import os import os
import re import re
import traceback import traceback
@ -8,6 +7,7 @@ from dataclasses import dataclass
from typing import Any from typing import Any
from typing import Callable from typing import Callable
from typing import Optional from typing import Optional
from typing import Union
from lxml import etree # type: ignore from lxml import etree # type: ignore
from SpiffWorkflow.bpmn.exceptions import WorkflowTaskException # type: ignore from SpiffWorkflow.bpmn.exceptions import WorkflowTaskException # type: ignore
@ -103,7 +103,7 @@ class ProcessModelTestRunner:
process_model_directory_path: str, process_model_directory_path: str,
process_model_directory_for_test_discovery: Optional[str] = None, process_model_directory_for_test_discovery: Optional[str] = None,
instantiate_executer_callback: Optional[Callable[[str], Any]] = 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, get_next_task_callback: Optional[Callable[[Any], Any]] = None,
test_case_file: Optional[str] = None, test_case_file: Optional[str] = None,
test_case_identifier: 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: def _get_relative_path_of_bpmn_file(self, bpmn_file: str) -> str:
return os.path.relpath(bpmn_file, start=self.process_model_directory_path) 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") error_messages = str(exception).split("\n")
test_case_error_details = TestCaseErrorDetails(error_messages=error_messages) test_case_error_details = TestCaseErrorDetails(error_messages=error_messages)
if isinstance(exception, WorkflowTaskException): if isinstance(exception, WorkflowTaskException):

View File

@ -1,5 +1,4 @@
import os import os
# from typing import Any
from typing import Optional from typing import Optional
import pytest import pytest