Files
notifications-api/tests/app/clients/test_cbc_proxy.py
Toby Lorne ee79768d43 clients: cbc_proxy client uses _ld not _lambda
_ld is better than _lambda because it causes primitive python syntax
highlighting to not get confused

_lambda is better than _ld because it is less jargon

Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
Co-authored-by: Pea <pea.tyczynska@digital.cabinet-office.gov.uk>
Co-authored-by: Katie <katie.smith@digital.cabinet-office.gov.uk>
2020-10-20 13:59:52 +01:00

28 lines
860 B
Python

import pytest
from app.clients.cbc_proxy import CBCProxyClient
@pytest.fixture(scope='function')
def cbc_proxy(client, mocker):
client = CBCProxyClient()
current_app = mocker.Mock(config={
'CBC_PROXY_AWS_ACCESS_KEY_ID': 'cbc-proxy-aws-access-key-id',
'CBC_PROXY_AWS_SECRET_ACCESS_KEY': 'cbc-proxy-aws-secret-access-key',
})
client.init_app(current_app)
return client
def test_cbc_proxy_ld_client_has_correct_region(cbc_proxy):
assert cbc_proxy._ld_client._client_config.region_name == 'eu-west-2'
pass
def test_cbc_proxy_ld_client_has_correct_keys(cbc_proxy):
key = cbc_proxy._ld_client._request_signer._credentials.access_key
secret = cbc_proxy._ld_client._request_signer._credentials.secret_key
assert key == 'cbc-proxy-aws-access-key-id'
assert secret == 'cbc-proxy-aws-secret-access-key'