mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Add task to send canary to cbc proxy
Create and schedule a Celery task that tests if we can send a canary message to cbc proxy. This will help us know if something happens to our connection to cbc proxy. 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: Richard <richard.baker@digital.cabinet-office.gov.uk>
This commit is contained in:
committed by
Pea Tyczynska
parent
052de84c9e
commit
be90455944
@@ -1,3 +1,4 @@
|
||||
import uuid
|
||||
from datetime import datetime, timedelta
|
||||
from unittest.mock import call
|
||||
|
||||
@@ -555,3 +556,22 @@ def test_check_for_services_with_high_failure_rates_or_sending_to_tv_numbers(
|
||||
subject="[test] High failure rates for sms spotted for services",
|
||||
ticket_type='incident'
|
||||
)
|
||||
|
||||
|
||||
def test_send_canary_to_cbc_proxy_invokes_cbc_proxy_client(
|
||||
mocker,
|
||||
):
|
||||
mock_send_canary = mocker.patch(
|
||||
'app.cbc_proxy_client.send_canary',
|
||||
)
|
||||
|
||||
scheduled_tasks.send_canary_to_cbc_proxy()
|
||||
|
||||
mock_send_canary.assert_called
|
||||
# the 0th argument of the call to send_canary
|
||||
identifier = mock_send_canary.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