77import responses
88from responses import matchers
99
10- from common .api_clients .authentication import AppRestrictedAuth , Service
10+ from common .api_clients .authentication import AppRestrictedAuth
1111from common .models .errors import UnhandledResponseError
1212
1313
@@ -33,7 +33,7 @@ def setUp(self):
3333 self .cache .get .return_value = None
3434
3535 env = "an-env"
36- self .authenticator = AppRestrictedAuth (Service . PDS , self .secret_manager_client , env , self .cache )
36+ self .authenticator = AppRestrictedAuth (self .secret_manager_client , env , self .cache )
3737 self .url = f"https://{ env } .api.service.nhs.uk/oauth2/token"
3838
3939 @responses .activate
@@ -89,12 +89,12 @@ def test_env_mapping(self):
8989 """it should target int environment for none-prod environment, otherwise int"""
9090 # For env=none-prod
9191 env = "some-env"
92- auth = AppRestrictedAuth (Service . PDS , None , env , None )
92+ auth = AppRestrictedAuth (None , env , None )
9393 self .assertTrue (auth .token_url .startswith (f"https://{ env } ." ))
9494
9595 # For env=prod
9696 env = "prod"
97- auth = AppRestrictedAuth (Service . PDS , None , env , None )
97+ auth = AppRestrictedAuth (None , env , None )
9898 self .assertTrue (env not in auth .token_url )
9999
100100 def test_returned_cached_token (self ):
@@ -126,7 +126,7 @@ def test_update_cache(self):
126126 self .authenticator .get_access_token ()
127127
128128 # Then
129- self .cache .put .assert_called_once_with (f" { Service . PDS . value } _access_token " , cached_token )
129+ self .cache .put .assert_called_once_with ("api_client_access_token " , cached_token )
130130
131131 @responses .activate
132132 def test_expired_token_in_cache (self ):
0 commit comments