mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
clients: cbc_proxy lambda client is unabbreviated
for code clarity Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
This commit is contained in:
@@ -46,7 +46,7 @@ class CBCProxyNoopClient:
|
|||||||
class CBCProxyClient:
|
class CBCProxyClient:
|
||||||
|
|
||||||
def init_app(self, app):
|
def init_app(self, app):
|
||||||
self._ld_client = boto3.client(
|
self._lambda_client = boto3.client(
|
||||||
'lambda',
|
'lambda',
|
||||||
region_name='eu-west-2',
|
region_name='eu-west-2',
|
||||||
aws_access_key_id=app.config['CBC_PROXY_AWS_ACCESS_KEY_ID'],
|
aws_access_key_id=app.config['CBC_PROXY_AWS_ACCESS_KEY_ID'],
|
||||||
@@ -63,7 +63,7 @@ class CBCProxyClient:
|
|||||||
'description': description,
|
'description': description,
|
||||||
}), encoding='utf8')
|
}), encoding='utf8')
|
||||||
|
|
||||||
result = self._ld_client.invoke(
|
result = self._lambda_client.invoke(
|
||||||
FunctionName='bt-ee-1-proxy',
|
FunctionName='bt-ee-1-proxy',
|
||||||
InvocationType='RequestResponse',
|
InvocationType='RequestResponse',
|
||||||
Payload=payload_bytes,
|
Payload=payload_bytes,
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ def cbc_proxy(client, mocker):
|
|||||||
return client
|
return client
|
||||||
|
|
||||||
|
|
||||||
def test_cbc_proxy_ld_client_has_correct_region(cbc_proxy):
|
def test_cbc_proxy_lambda_client_has_correct_region(cbc_proxy):
|
||||||
assert cbc_proxy._ld_client._client_config.region_name == 'eu-west-2'
|
assert cbc_proxy._lambda_client._client_config.region_name == 'eu-west-2'
|
||||||
|
|
||||||
|
|
||||||
def test_cbc_proxy_ld_client_has_correct_keys(cbc_proxy):
|
def test_cbc_proxy_lambda_client_has_correct_keys(cbc_proxy):
|
||||||
key = cbc_proxy._ld_client._request_signer._credentials.access_key
|
key = cbc_proxy._lambda_client._request_signer._credentials.access_key
|
||||||
secret = cbc_proxy._ld_client._request_signer._credentials.secret_key
|
secret = cbc_proxy._lambda_client._request_signer._credentials.secret_key
|
||||||
|
|
||||||
assert key == 'cbc-proxy-aws-access-key-id'
|
assert key == 'cbc-proxy-aws-access-key-id'
|
||||||
assert secret == 'cbc-proxy-aws-secret-access-key'
|
assert secret == 'cbc-proxy-aws-secret-access-key'
|
||||||
@@ -35,7 +35,7 @@ def test_cbc_proxy_create_and_send_invokes_function(mocker, cbc_proxy):
|
|||||||
|
|
||||||
ld_client_mock = mocker.patch.object(
|
ld_client_mock = mocker.patch.object(
|
||||||
cbc_proxy,
|
cbc_proxy,
|
||||||
'_ld_client',
|
'_lambda_client',
|
||||||
create=True,
|
create=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ def test_cbc_proxy_create_and_send_handles_invoke_error(mocker, cbc_proxy):
|
|||||||
|
|
||||||
ld_client_mock = mocker.patch.object(
|
ld_client_mock = mocker.patch.object(
|
||||||
cbc_proxy,
|
cbc_proxy,
|
||||||
'_ld_client',
|
'_lambda_client',
|
||||||
create=True,
|
create=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ def test_cbc_proxy_create_and_send_handles_function_error(mocker, cbc_proxy):
|
|||||||
|
|
||||||
ld_client_mock = mocker.patch.object(
|
ld_client_mock = mocker.patch.object(
|
||||||
cbc_proxy,
|
cbc_proxy,
|
||||||
'_ld_client',
|
'_lambda_client',
|
||||||
create=True,
|
create=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user