mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
client: cbc_proxy passes through sent/expires
A BroadcastEvent knows when an event was sent and should expire We pass through these values directly to the CBC Proxy, because BroadcastEvent knows how they should be formatted Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
This commit is contained in:
@@ -34,6 +34,9 @@ def test_cbc_proxy_create_and_send_invokes_function(mocker, cbc_proxy):
|
||||
headline = 'my-headline'
|
||||
description = 'my-description'
|
||||
|
||||
sent = 'a-passed-through-sent-value'
|
||||
expires = 'a-passed-through-expires-value'
|
||||
|
||||
# a single area which is a square including london
|
||||
areas = [{
|
||||
'description': 'london',
|
||||
@@ -61,6 +64,7 @@ def test_cbc_proxy_create_and_send_invokes_function(mocker, cbc_proxy):
|
||||
headline=headline,
|
||||
description=description,
|
||||
areas=areas,
|
||||
sent=sent, expires=expires,
|
||||
)
|
||||
|
||||
ld_client_mock.invoke.assert_called_once_with(
|
||||
@@ -78,6 +82,8 @@ def test_cbc_proxy_create_and_send_invokes_function(mocker, cbc_proxy):
|
||||
assert payload['headline'] == headline
|
||||
assert payload['description'] == description
|
||||
assert payload['areas'] == areas
|
||||
assert payload['sent'] == sent
|
||||
assert payload['expires'] == expires
|
||||
|
||||
|
||||
def test_cbc_proxy_create_and_send_handles_invoke_error(mocker, cbc_proxy):
|
||||
@@ -85,6 +91,9 @@ def test_cbc_proxy_create_and_send_handles_invoke_error(mocker, cbc_proxy):
|
||||
headline = 'my-headline'
|
||||
description = 'my-description'
|
||||
|
||||
sent = 'a-passed-through-sent-value'
|
||||
expires = 'a-passed-through-expires-value'
|
||||
|
||||
# a single area which is a square including london
|
||||
areas = [{
|
||||
'description': 'london',
|
||||
@@ -113,6 +122,7 @@ def test_cbc_proxy_create_and_send_handles_invoke_error(mocker, cbc_proxy):
|
||||
headline=headline,
|
||||
description=description,
|
||||
areas=areas,
|
||||
sent=sent, expires=expires,
|
||||
)
|
||||
|
||||
assert e.match('Could not invoke lambda')
|
||||
@@ -129,6 +139,9 @@ def test_cbc_proxy_create_and_send_handles_function_error(mocker, cbc_proxy):
|
||||
headline = 'my-headline'
|
||||
description = 'my-description'
|
||||
|
||||
sent = 'a-passed-through-sent-value'
|
||||
expires = 'a-passed-through-expires-value'
|
||||
|
||||
# a single area which is a square including london
|
||||
areas = [{
|
||||
'description': 'london',
|
||||
@@ -158,6 +171,7 @@ def test_cbc_proxy_create_and_send_handles_function_error(mocker, cbc_proxy):
|
||||
headline=headline,
|
||||
description=description,
|
||||
areas=areas,
|
||||
sent=sent, expires=expires,
|
||||
)
|
||||
|
||||
assert e.match('Function exited with unhandled exception')
|
||||
|
||||
Reference in New Issue
Block a user