From fa9294331722f23557ff2606c823bf05d686d83b Mon Sep 17 00:00:00 2001 From: burnettk Date: Fri, 25 Nov 2022 00:46:43 -0500 Subject: [PATCH] lint --- spiffworkflow-backend/migrations/env.py | 2 -- .../routes/process_api_blueprint.py | 4 ++-- .../services/process_model_service.py | 14 ++++++++++---- .../helpers/base_test.py | 2 +- .../integration/test_process_api.py | 6 +++--- .../unit/test_acceptance_test_fixtures.py | 19 ++++++++++++++----- 6 files changed, 30 insertions(+), 17 deletions(-) diff --git a/spiffworkflow-backend/migrations/env.py b/spiffworkflow-backend/migrations/env.py index 68feded2a..630e381ad 100644 --- a/spiffworkflow-backend/migrations/env.py +++ b/spiffworkflow-backend/migrations/env.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import logging from logging.config import fileConfig diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py index b28f83907..f0cdb992d 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py @@ -242,7 +242,7 @@ def process_group_show( def process_group_move( modified_process_group_identifier: str, new_location: str ) -> flask.wrappers.Response: - """process_group_move.""" + """Process_group_move.""" original_process_group_id = un_modify_modified_process_model_id( modified_process_group_identifier ) @@ -343,7 +343,7 @@ def process_model_show(modified_process_model_identifier: str) -> Any: def process_model_move( modified_process_model_identifier: str, new_location: str ) -> flask.wrappers.Response: - """process_model_move.""" + """Process_model_move.""" original_process_model_id = un_modify_modified_process_model_id( modified_process_model_identifier ) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py index d74e57229..5287ecf3c 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py @@ -47,11 +47,14 @@ class ProcessModelService(FileSystemService): @classmethod def is_group_identifier(cls, process_group_identifier: str) -> bool: + """Is_group_identifier.""" 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), + FileSystemService.id_string_to_relative_path( + process_group_identifier + ), ) ) return cls.is_group(process_group_path) @@ -68,11 +71,14 @@ class ProcessModelService(FileSystemService): @classmethod def is_model_identifier(cls, process_model_identifier: str) -> bool: + """Is_model_identifier.""" 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), + FileSystemService.id_string_to_relative_path( + process_model_identifier + ), ) ) return cls.is_model(process_model_path) @@ -150,7 +156,7 @@ class ProcessModelService(FileSystemService): def process_model_move( self, original_process_model_id: str, new_location: str ) -> ProcessModelInfo: - """process_model_move.""" + """Process_model_move.""" original_model_path = os.path.abspath( os.path.join(FileSystemService.root_path(), original_process_model_id) ) @@ -300,7 +306,7 @@ class ProcessModelService(FileSystemService): def process_group_move( self, original_process_group_id: str, new_location: str ) -> ProcessGroup: - """process_group_move.""" + """Process_group_move.""" original_group_path = self.process_group_path(original_process_group_id) original_root, original_group_id = os.path.split(original_group_path) new_root = f"{FileSystemService.root_path()}/{new_location}" diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/helpers/base_test.py b/spiffworkflow-backend/tests/spiffworkflow_backend/helpers/base_test.py index 83a376be2..8d56853b4 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/helpers/base_test.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/helpers/base_test.py @@ -261,7 +261,7 @@ class BaseTest: load_test_spec( process_model_id=test_process_model_id, process_model_source_directory=basename, - bpmn_file_name=basename + bpmn_file_name=basename, ) modified_process_model_id = test_process_model_id.replace("/", ":") response = client.post( diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py index 307179de0..5ee5ae9f2 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py @@ -2436,7 +2436,7 @@ class TestProcessApi(BaseTest): def setup_initial_groups_for_move_tests( self, client: FlaskClient, with_super_admin_user: UserModel ) -> None: - """setup_initial_groups_for_move_tests.""" + """Setup_initial_groups_for_move_tests.""" groups = ["group_a", "group_b", "group_b/group_bb"] # setup initial groups for group in groups: @@ -2456,7 +2456,7 @@ class TestProcessApi(BaseTest): with_db_and_bpmn_file_cleanup: None, with_super_admin_user: UserModel, ) -> None: - """test_move_model.""" + """Test_move_model.""" self.setup_initial_groups_for_move_tests(client, with_super_admin_user) process_model_id = "test_model" @@ -2508,7 +2508,7 @@ class TestProcessApi(BaseTest): with_db_and_bpmn_file_cleanup: None, with_super_admin_user: UserModel, ) -> None: - """test_move_group.""" + """Test_move_group.""" self.setup_initial_groups_for_move_tests(client, with_super_admin_user) # add sub group to `group_a` diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_acceptance_test_fixtures.py b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_acceptance_test_fixtures.py index fead0545b..c738c7f69 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_acceptance_test_fixtures.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_acceptance_test_fixtures.py @@ -1,9 +1,10 @@ """Test_acceptance_test_fixtures.""" -from flask.app import Flask import os + +from flask.app import Flask + from spiffworkflow_backend.models.process_group import ProcessGroup from spiffworkflow_backend.models.process_model import ProcessModelInfo - from spiffworkflow_backend.services.acceptance_test_fixtures import ( load_acceptance_test_fixtures, ) @@ -12,17 +13,25 @@ from spiffworkflow_backend.services.process_model_service import ProcessModelSer def test_start_dates_are_one_hour_apart(app: Flask) -> None: """Test_start_dates_are_one_hour_apart.""" - process_model_identifier = 'misc/acceptance-tests-group-one/acceptance-tests-model-1' + process_model_identifier = ( + "misc/acceptance-tests-group-one/acceptance-tests-model-1" + ) group_identifier = os.path.dirname(process_model_identifier) parent_group_identifier = os.path.dirname(group_identifier) if not ProcessModelService.is_group(parent_group_identifier): - process_group = ProcessGroup(id=parent_group_identifier, display_name=parent_group_identifier) + process_group = ProcessGroup( + id=parent_group_identifier, display_name=parent_group_identifier + ) ProcessModelService.add_process_group(process_group) if not ProcessModelService.is_group(group_identifier): process_group = ProcessGroup(id=group_identifier, display_name=group_identifier) ProcessModelService.add_process_group(process_group) if not ProcessModelService.is_model(process_model_identifier): - process_model = ProcessModelInfo(id=process_model_identifier, display_name=process_model_identifier, description='hey') + process_model = ProcessModelInfo( + id=process_model_identifier, + display_name=process_model_identifier, + description="hey", + ) ProcessModelService.add_process_model(process_model) process_instances = load_acceptance_test_fixtures()