Skip to content

Commit

Permalink
make format
Browse files Browse the repository at this point in the history
  • Loading branch information
NogaNHS committed Dec 11, 2023
1 parent d43ac37 commit 96dcae9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 22 deletions.
7 changes: 5 additions & 2 deletions lambdas/services/ods_api_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down
1 change: 0 additions & 1 deletion lambdas/tests/unit/handlers/test_token_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from enums.repository_role import OrganisationRelationship

MOCK_GP_NAME = "Mock GP Practice"

NON_BSOL_ORGANISATION_RESPONSE = {
Expand Down
20 changes: 7 additions & 13 deletions lambdas/tests/unit/services/test_login_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"}

Expand Down
21 changes: 15 additions & 6 deletions lambdas/tests/unit/services/test_ods_api_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 96dcae9

Please sign in to comment.