mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-26 17:23:50 -04:00
separate cbc proxy into separate clients
this is a pretty big and convoluted refactor unfortunately.
Previously:
There was one global `cbc_proxy_client` object in apps. This class has
the information about how to invoke the bt-ee lambda, and handles all
calls to lambda. This includes calls to the canary too (which is a
separate lambda).
The future:
There's one global `cbc_proxy_client`. This knows about the different
provider functions and lambdas, and you'll need to ask this client for a
proxy for your chosen provider. call cbc_proxy_client.get_proxy('ee')`
and it'll return you a proxy that knows what ee's lambda function is,
how to transform any content in a way that is exclusive to ee, and in
future how to parse any response from ee.
The present:
I also cleaned up some duplicate tests.
I'm really not sure about the names of some of these variables - in
particular `cbc_proxy_client` isn't a client - it's more of a java style
factory, where you call a function on it to get the client of your
choice.
This commit is contained in:
@@ -561,9 +561,10 @@ def test_check_for_services_with_high_failure_rates_or_sending_to_tv_numbers(
|
||||
|
||||
def test_send_canary_to_cbc_proxy_invokes_cbc_proxy_client(
|
||||
mocker,
|
||||
notify_api
|
||||
):
|
||||
mock_send_canary = mocker.patch(
|
||||
'app.cbc_proxy_client.send_canary',
|
||||
'app.clients.cbc_proxy.CBCProxyCanary.send_canary',
|
||||
)
|
||||
|
||||
scheduled_tasks.send_canary_to_cbc_proxy()
|
||||
|
||||
Reference in New Issue
Block a user