tests passing

This commit is contained in:
burnettk 2022-11-25 00:08:38 -05:00
parent 5b73c4ddb0
commit 1711837e88
4 changed files with 30 additions and 4 deletions

View File

@ -1148,7 +1148,7 @@ def task_list_my_tasks(page: int = 1, per_page: int = 100) -> flask.wrappers.Res
# just need this add_columns to add the process_model_identifier. Then add everything back that was removed. # just need this add_columns to add the process_model_identifier. Then add everything back that was removed.
.add_columns( .add_columns(
ProcessInstanceModel.process_model_identifier, ProcessInstanceModel.process_model_identifier,
ProcessInstanceModel.process_group_identifier, ProcessInstanceModel.process_model_display_name,
ProcessInstanceModel.status, ProcessInstanceModel.status,
ActiveTaskModel.task_name, ActiveTaskModel.task_name,
ActiveTaskModel.task_title, ActiveTaskModel.task_title,

View File

@ -45,6 +45,19 @@ class ProcessModelService(FileSystemService):
return True return True
return False return False
@classmethod
def is_group_identifier(cls, process_group_identifier: str) -> bool:
if os.path.exists(FileSystemService.root_path()):
process_group_path = os.path.abspath(
os.path.join(
FileSystemService.root_path(),
FileSystemService.id_string_to_relative_path(process_group_identifier),
)
)
return cls.is_group(process_group_path)
return False
@classmethod @classmethod
def is_model(cls, path: str) -> bool: def is_model(cls, path: str) -> bool:
"""Is_model.""" """Is_model."""
@ -53,6 +66,19 @@ class ProcessModelService(FileSystemService):
return True return True
return False return False
@classmethod
def is_model_identifier(cls, process_model_identifier: str) -> bool:
if os.path.exists(FileSystemService.root_path()):
process_model_path = os.path.abspath(
os.path.join(
FileSystemService.root_path(),
FileSystemService.id_string_to_relative_path(process_model_identifier),
)
)
return cls.is_model(process_model_path)
return False
@staticmethod @staticmethod
def write_json_file( def write_json_file(
file_path: str, json_data: dict, indent: int = 4, sort_keys: bool = True file_path: str, json_data: dict, indent: int = 4, sort_keys: bool = True

View File

@ -252,9 +252,9 @@ class BaseTest:
There must be an existing process model to instantiate. There must be an existing process model to instantiate.
""" """
if not ProcessModelService.is_model(test_process_model_id): if not ProcessModelService.is_model_identifier(test_process_model_id):
dirname = os.path.dirname(test_process_model_id) dirname = os.path.dirname(test_process_model_id)
if not ProcessModelService.is_group(dirname): if not ProcessModelService.is_group_identifier(dirname):
process_group = ProcessGroup(id=dirname, display_name=dirname) process_group = ProcessGroup(id=dirname, display_name=dirname)
ProcessModelService.add_process_group(process_group) ProcessModelService.add_process_group(process_group)
basename = os.path.basename(test_process_model_id) basename = os.path.basename(test_process_model_id)

View File

@ -1548,7 +1548,7 @@ class TestProcessApi(BaseTest):
status=ProcessInstanceStatus[statuses[i]].value, status=ProcessInstanceStatus[statuses[i]].value,
process_initiator=with_super_admin_user, process_initiator=with_super_admin_user,
process_model_identifier=process_model_identifier, process_model_identifier=process_model_identifier,
process_group_identifier="test_process_group_id", process_model_display_name=process_model_identifier,
updated_at_in_seconds=round(time.time()), updated_at_in_seconds=round(time.time()),
start_in_seconds=(1000 * i) + 1000, start_in_seconds=(1000 * i) + 1000,
end_in_seconds=(1000 * i) + 2000, end_in_seconds=(1000 * i) + 2000,