diff --git a/lambdas/services/ods_api_service.py b/lambdas/services/ods_api_service.py index 7151a235b..1c3b765c7 100644 --- a/lambdas/services/ods_api_service.py +++ b/lambdas/services/ods_api_service.py @@ -4,8 +4,11 @@ from enums.repository_role import OrganisationRelationship from services.token_handler_ssm_service import TokenHandlerSSMService from utils.audit_logging_setup import LoggingService -from utils.exceptions import (OdsErrorException, OrganisationNotFoundException, - TooManyOrgsException) +from utils.exceptions import ( + OdsErrorException, + OrganisationNotFoundException, + TooManyOrgsException, +) logger = LoggingService(__name__) diff --git a/lambdas/tests/unit/handlers/test_token_handler.py b/lambdas/tests/unit/handlers/test_token_handler.py index ddf111063..508bf54e9 100644 --- a/lambdas/tests/unit/handlers/test_token_handler.py +++ b/lambdas/tests/unit/handlers/test_token_handler.py @@ -14,7 +14,6 @@ def mock_login_service(mocker, set_env): def test_lambda_handler_respond_with_200_including_org_info_and_auth_token( - mock_login_service, context, ): diff --git a/lambdas/tests/unit/helpers/data/ods/ods_organisation_response.py b/lambdas/tests/unit/helpers/data/ods/ods_organisation_response.py index d334223c1..de8be3067 100644 --- a/lambdas/tests/unit/helpers/data/ods/ods_organisation_response.py +++ b/lambdas/tests/unit/helpers/data/ods/ods_organisation_response.py @@ -1,4 +1,5 @@ from enums.repository_role import OrganisationRelationship + MOCK_GP_NAME = "Mock GP Practice" NON_BSOL_ORGANISATION_RESPONSE = { diff --git a/lambdas/tests/unit/services/test_login_service.py b/lambdas/tests/unit/services/test_login_service.py index d254d5939..ea376b914 100644 --- a/lambdas/tests/unit/services/test_login_service.py +++ b/lambdas/tests/unit/services/test_login_service.py @@ -138,10 +138,10 @@ def test_exchange_token_respond_with_auth_token_and_repo_role( mocker.patch.object(DynamoDBService, "delete_item") expected = { - "isBSOL": expected_is_bsol, - "role": expected_role.value, - "authorisation_token": expected_jwt, - } + "isBSOL": expected_is_bsol, + "role": expected_role.value, + "authorisation_token": expected_jwt, + } login_service = LoginService() @@ -253,9 +253,7 @@ def test_exchange_token_raises_error_when_encounter_boto3_error( assert error.status_code == 500 -def test_generate_repository_role_gp_admin( - mock_logging_service, set_env, mocker -): +def test_generate_repository_role_gp_admin(mock_logging_service, set_env, mocker): ods_code = "ods_code" org_role_code = "org_role_code" user_role_code = "role_code" @@ -277,9 +275,7 @@ def test_generate_repository_role_gp_admin( assert expected == actual -def test_generate_repository_role_gp_clinical( - mock_logging_service, set_env, mocker -): +def test_generate_repository_role_gp_clinical(mock_logging_service, set_env, mocker): ods_code = "ods_code" org_role_code = "org_role_code" user_role_code = "role_code" @@ -336,9 +332,7 @@ def test_generate_repository_role_pcse(mock_logging_service, set_env, mocker): assert expected == actual -def test_generate_repository_role_no_role( - mock_logging_service, set_env, mocker -): +def test_generate_repository_role_no_role(mock_logging_service, set_env, mocker): user_role_code = "role_code" org = {"org_ods_code": "ods_code", "role_code": "not_gp_or_pcse"} diff --git a/lambdas/tests/unit/services/test_ods_api_service.py b/lambdas/tests/unit/services/test_ods_api_service.py index 08747e86b..db36879fb 100644 --- a/lambdas/tests/unit/services/test_ods_api_service.py +++ b/lambdas/tests/unit/services/test_ods_api_service.py @@ -2,16 +2,25 @@ import pytest from requests import Response -from services.ods_api_service import (OdsApiService, find_org_relationship, - parse_ods_response) +from services.ods_api_service import ( + OdsApiService, + find_org_relationship, + parse_ods_response, +) from services.token_handler_ssm_service import TokenHandlerSSMService from tests.unit.helpers.data.ods.ods_organisation_response import ( - BSOL_ORGANISATION_RESPONSE, NO_RELS_RESPONSE, - NON_BSOL_ORGANISATION_RESPONSE, RE6_REL_ID_RESPONSE) + BSOL_ORGANISATION_RESPONSE, + NO_RELS_RESPONSE, + NON_BSOL_ORGANISATION_RESPONSE, + RE6_REL_ID_RESPONSE, +) from tests.unit.helpers.data.ods.utils import load_ods_response_data from tests.unit.helpers.mock_response import MockResponse -from utils.exceptions import (OdsErrorException, OrganisationNotFoundException, - TooManyOrgsException) +from utils.exceptions import ( + OdsErrorException, + OrganisationNotFoundException, + TooManyOrgsException, +) def test_fetch_organisation_data_returns_organisation_data(mocker):