mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
celery: add task for triggering link tests
We want to periodically kick off some link tests, so that: - we are periodically communicating with the CBC Proxies - each CBC Proxy is periodically communicating with its CBC This simulation of traffic to the CBC will give us advance warning if something is going to break, or is broken, before someone tries to send a real live message Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk> Co-authored-by: Richard <richard.baker@digital.cabinet-office.gov.uk> Co-authored-by: Pea <pea.tyczynska@digital.cabinet-office.gov.uk>
This commit is contained in:
@@ -575,3 +575,22 @@ def test_send_canary_to_cbc_proxy_invokes_cbc_proxy_client(
|
||||
uuid.UUID(identifier)
|
||||
except BaseException:
|
||||
pytest.fail(f"{identifier} is not a valid uuid")
|
||||
|
||||
|
||||
def test_trigger_link_tests_invokes_cbc_proxy_client(
|
||||
mocker,
|
||||
):
|
||||
mock_send_link_test = mocker.patch(
|
||||
'app.cbc_proxy_client.send_link_test',
|
||||
)
|
||||
|
||||
scheduled_tasks.trigger_link_tests()
|
||||
|
||||
mock_send_link_test.assert_called
|
||||
# the 0th argument of the call to send_link_test
|
||||
identifier = mock_send_link_test.mock_calls[0][1][0]
|
||||
|
||||
try:
|
||||
uuid.UUID(identifier)
|
||||
except BaseException:
|
||||
pytest.fail(f"{identifier} is not a valid uuid")
|
||||
|
||||
Reference in New Issue
Block a user