From cfa738f128959f423ca7f87611db13d0c63824fa Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Mon, 27 Jun 2022 12:56:13 -0400 Subject: [PATCH] run precommit --- .../services/email_service.py | 15 +++++++++------ .../services/error_handling_service.py | 10 ++++++++-- .../integration/test_process_api.py | 4 +++- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/spiffworkflow_backend/services/email_service.py b/src/spiffworkflow_backend/services/email_service.py index 9b2e12ba..461c9fd2 100644 --- a/src/spiffworkflow_backend/services/email_service.py +++ b/src/spiffworkflow_backend/services/email_service.py @@ -1,7 +1,10 @@ """Email_service.""" +from typing import List +from typing import Optional + from flask import current_app from flask_mail import Message # type: ignore -from typing import List, Optional + class EmailService: """Provides common interface for working with an Email.""" @@ -13,11 +16,11 @@ class EmailService: recipients: List[str], content: str, content_html: str, - cc: Optional[str]=None, - bcc: Optional[str]=None, - reply_to: Optional[str]=None, - attachment_files: Optional[dict]=None, - ) ->None: + cc: Optional[str] = None, + bcc: Optional[str] = None, + reply_to: Optional[str] = None, + attachment_files: Optional[dict] = None, + ) -> None: """We will receive all data related to an email and send it.""" mail = current_app.config["MAIL_APP"] diff --git a/src/spiffworkflow_backend/services/error_handling_service.py b/src/spiffworkflow_backend/services/error_handling_service.py index 97b81d59..26d24da4 100644 --- a/src/spiffworkflow_backend/services/error_handling_service.py +++ b/src/spiffworkflow_backend/services/error_handling_service.py @@ -1,5 +1,7 @@ """Error_handling_service.""" -from typing import Any, List, Union +from typing import Any +from typing import List +from typing import Union from flask_bpmn.api.api_error import ApiError from flask_bpmn.models.db import db @@ -64,7 +66,11 @@ class ErrorHandlingService: ... @staticmethod - def handle_email_notification(processor: ProcessInstanceProcessor, error: Union[ApiError, Exception], recipients: List) ->None: + def handle_email_notification( + processor: ProcessInstanceProcessor, + error: Union[ApiError, Exception], + recipients: List, + ) -> None: """EmailHandler.""" subject = "Unexpected error in app" if isinstance(error, ApiError): diff --git a/tests/spiffworkflow_backend/integration/test_process_api.py b/tests/spiffworkflow_backend/integration/test_process_api.py index cabcc9a2..5515c9c6 100644 --- a/tests/spiffworkflow_backend/integration/test_process_api.py +++ b/tests/spiffworkflow_backend/integration/test_process_api.py @@ -821,7 +821,9 @@ def test_process_instance_report_with_default_list( assert process_instance_dict["status"] == "not_started" -def setup_testing_instance(client: FlaskClient, process_group_id: str, process_model_id: str, user: UserModel) -> Any: +def setup_testing_instance( + client: FlaskClient, process_group_id: str, process_model_id: str, user: UserModel +) -> Any: """Setup_testing_instance.""" headers = logged_in_headers(user) response = create_process_instance(