From f9b1d3d573f89a5f53d706ad2a1b582e57f7adc7 Mon Sep 17 00:00:00 2001 From: David McDonald Date: Wed, 27 Jan 2021 15:19:41 +0000 Subject: [PATCH] Set the default broadcast channel to test This used to be hardcoded in the CBC proxy but now we will hardcode it in the cbc_proxy_client. In a future PR we can start choosing which channel a broadcast will go to based on the channel configured for that broadcast service. --- app/clients/cbc_proxy.py | 4 ++++ tests/app/clients/test_cbc_proxy.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/clients/cbc_proxy.py b/app/clients/cbc_proxy.py index 03aebe393..aba451bf9 100644 --- a/app/clients/cbc_proxy.py +++ b/app/clients/cbc_proxy.py @@ -210,6 +210,7 @@ class CBCProxyEE(CBCProxyClientBase): 'sent': sent, 'expires': expires, 'language': self.infer_language_from(description), + 'channel': 'test', } self._invoke_lambda_with_failover(payload=payload) @@ -270,6 +271,7 @@ class CBCProxyThree(CBCProxyClientBase): 'sent': sent, 'expires': expires, 'language': self.infer_language_from(description), + 'channel': 'test', } self._invoke_lambda_with_failover(payload=payload) @@ -329,6 +331,7 @@ class CBCProxyO2(CBCProxyClientBase): 'sent': sent, 'expires': expires, 'language': self.infer_language_from(description), + 'channel': 'test', } self._invoke_lambda_with_failover(payload=payload) @@ -391,6 +394,7 @@ class CBCProxyVodafone(CBCProxyClientBase): 'sent': sent, 'expires': expires, 'language': self.infer_language_from(description), + 'channel': 'test', } self._invoke_lambda_with_failover(payload=payload) diff --git a/tests/app/clients/test_cbc_proxy.py b/tests/app/clients/test_cbc_proxy.py index 64c62df4a..70a3bcd13 100644 --- a/tests/app/clients/test_cbc_proxy.py +++ b/tests/app/clients/test_cbc_proxy.py @@ -133,6 +133,7 @@ def test_cbc_proxy_one_2_many_create_and_send_invokes_function( assert payload['sent'] == sent assert payload['expires'] == expires assert payload['language'] == expected_language + assert payload['channel'] == 'test' @pytest.mark.parametrize('cbc', ['bt-ee', 'three', 'o2']) @@ -249,6 +250,7 @@ def test_cbc_proxy_vodafone_create_and_send_invokes_function( assert payload['sent'] == sent assert payload['expires'] == expires assert payload['language'] == expected_language + assert payload['channel'] == 'test' def test_cbc_proxy_vodafone_cancel_invokes_function(mocker, cbc_proxy_vodafone):