From b151ef79372ff18afb8d202b6038426ef83a2681 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 19 Jan 2023 14:00:36 -0500 Subject: [PATCH] pre-commit-in-ci --- .../realm_exports/spiffworkflow-realm.json | 2 +- .../keycloak/test_user_lists/status | 1 - .../services/process_instance_processor.py | 5 +++-- .../unit/test_process_instance_service.py | 18 ++++++++++++------ 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/spiffworkflow-backend/keycloak/realm_exports/spiffworkflow-realm.json b/spiffworkflow-backend/keycloak/realm_exports/spiffworkflow-realm.json index 270e4876f..43139573b 100644 --- a/spiffworkflow-backend/keycloak/realm_exports/spiffworkflow-realm.json +++ b/spiffworkflow-backend/keycloak/realm_exports/spiffworkflow-realm.json @@ -3036,4 +3036,4 @@ "clientPolicies" : { "policies" : [ ] } -} \ No newline at end of file +} diff --git a/spiffworkflow-backend/keycloak/test_user_lists/status b/spiffworkflow-backend/keycloak/test_user_lists/status index e9c518374..b44d0664c 100644 --- a/spiffworkflow-backend/keycloak/test_user_lists/status +++ b/spiffworkflow-backend/keycloak/test_user_lists/status @@ -6,4 +6,3 @@ finance.sme@status.im infra.sme@status.im legal.sme@status.im security.sme@status.im - diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py index b99d52de8..0af4d2bde 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py @@ -692,8 +692,9 @@ class ProcessInstanceProcessor: ): continue - subprocesses_by_child_task_ids[task_id] =\ - subprocesses_by_child_task_ids[subprocess_id] + subprocesses_by_child_task_ids[ + task_id + ] = subprocesses_by_child_task_ids[subprocess_id] self.get_highest_level_calling_subprocesses_by_child_task_ids( subprocesses_by_child_task_ids, task_typename_by_task_id ) diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_service.py b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_service.py index bacde125b..2e104e0b3 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_service.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_service.py @@ -1,10 +1,11 @@ """Test_process_instance_processor.""" import os + 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.test_data import load_test_spec +from spiffworkflow_backend.models.spiff_logging import SpiffLoggingModel from spiffworkflow_backend.models.user import UserModel from spiffworkflow_backend.services.process_instance_processor import ( ProcessInstanceProcessor, @@ -20,8 +21,9 @@ class TestProcessInstanceService(BaseTest): with_db_and_bpmn_file_cleanup: None, with_super_admin_user: UserModel, ) -> None: - """Test_does_not_log_set_data_when_calling_engine_steps_on_waiting_call_activity.""" - tmp_file = '/tmp/testfile.txt' + """Test_does_not_log_set_data_when_calling_engine_steps_on_waiting_call_activity. + """ + tmp_file = "/tmp/testfile.txt" if os.path.isfile(tmp_file): os.remove(tmp_file) process_model = load_test_spec( @@ -34,13 +36,17 @@ class TestProcessInstanceService(BaseTest): processor = ProcessInstanceProcessor(process_instance) 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) # logs should NOT increase after running this a second time since it's just waiting on a human task print("HEY NOW") - with open(tmp_file, 'w') as f: + with open(tmp_file, "w") as f: f.write("HEY") 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