pre-commit-in-ci

This commit is contained in:
Dan 2023-01-19 14:00:36 -05:00
parent 59564d561d
commit b151ef7937
4 changed files with 16 additions and 10 deletions

View File

@ -6,4 +6,3 @@ finance.sme@status.im
infra.sme@status.im infra.sme@status.im
legal.sme@status.im legal.sme@status.im
security.sme@status.im security.sme@status.im

View File

@ -692,8 +692,9 @@ class ProcessInstanceProcessor:
): ):
continue continue
subprocesses_by_child_task_ids[task_id] =\ subprocesses_by_child_task_ids[
subprocesses_by_child_task_ids[subprocess_id] task_id
] = subprocesses_by_child_task_ids[subprocess_id]
self.get_highest_level_calling_subprocesses_by_child_task_ids( self.get_highest_level_calling_subprocesses_by_child_task_ids(
subprocesses_by_child_task_ids, task_typename_by_task_id subprocesses_by_child_task_ids, task_typename_by_task_id
) )

View File

@ -1,10 +1,11 @@
"""Test_process_instance_processor.""" """Test_process_instance_processor."""
import os import os
from flask.app import Flask from flask.app import Flask
from spiffworkflow_backend.models.spiff_logging import SpiffLoggingModel
from tests.spiffworkflow_backend.helpers.base_test import BaseTest from tests.spiffworkflow_backend.helpers.base_test import BaseTest
from tests.spiffworkflow_backend.helpers.test_data import load_test_spec from tests.spiffworkflow_backend.helpers.test_data import load_test_spec
from spiffworkflow_backend.models.spiff_logging import SpiffLoggingModel
from spiffworkflow_backend.models.user import UserModel from spiffworkflow_backend.models.user import UserModel
from spiffworkflow_backend.services.process_instance_processor import ( from spiffworkflow_backend.services.process_instance_processor import (
ProcessInstanceProcessor, ProcessInstanceProcessor,
@ -20,8 +21,9 @@ class TestProcessInstanceService(BaseTest):
with_db_and_bpmn_file_cleanup: None, with_db_and_bpmn_file_cleanup: None,
with_super_admin_user: UserModel, with_super_admin_user: UserModel,
) -> None: ) -> None:
"""Test_does_not_log_set_data_when_calling_engine_steps_on_waiting_call_activity.""" """Test_does_not_log_set_data_when_calling_engine_steps_on_waiting_call_activity.
tmp_file = '/tmp/testfile.txt' """
tmp_file = "/tmp/testfile.txt"
if os.path.isfile(tmp_file): if os.path.isfile(tmp_file):
os.remove(tmp_file) os.remove(tmp_file)
process_model = load_test_spec( process_model = load_test_spec(
@ -34,13 +36,17 @@ class TestProcessInstanceService(BaseTest):
processor = ProcessInstanceProcessor(process_instance) processor = ProcessInstanceProcessor(process_instance)
processor.do_engine_steps(save=True) processor.do_engine_steps(save=True)
process_instance_logs = SpiffLoggingModel.query.filter_by(process_instance_id=process_instance.id).all() process_instance_logs = SpiffLoggingModel.query.filter_by(
process_instance_id=process_instance.id
).all()
initial_length = len(process_instance_logs) initial_length = len(process_instance_logs)
# logs should NOT increase after running this a second time since it's just waiting on a human task # logs should NOT increase after running this a second time since it's just waiting on a human task
print("HEY NOW") print("HEY NOW")
with open(tmp_file, 'w') as f: with open(tmp_file, "w") as f:
f.write("HEY") f.write("HEY")
processor.do_engine_steps(save=True) processor.do_engine_steps(save=True)
process_instance_logs = SpiffLoggingModel.query.filter_by(process_instance_id=process_instance.id).all() process_instance_logs = SpiffLoggingModel.query.filter_by(
process_instance_id=process_instance.id
).all()
assert len(process_instance_logs) == initial_length assert len(process_instance_logs) == initial_length