fix tests

This commit is contained in:
Kenneth Kehl
2023-10-03 08:00:59 -07:00
parent ef64bd424a
commit 679dee8123

View File

@@ -1,4 +1,6 @@
# import pytest
from datetime import datetime
from flask import current_app
from app import aws_cloudwatch_client
@@ -61,8 +63,9 @@ def test_check_sms_success(notify_api, mocker):
message_id = "succeed"
notification_id = "ccc"
created_at = datetime.utcnow()
with notify_api.app_context():
aws_cloudwatch_client.check_sms(message_id, notification_id, 1000000000000)
aws_cloudwatch_client.check_sms(message_id, notification_id, created_at)
# We check the 'success' log group first and if we find the message_id, we are done, so there is only 1 call
assert boto_mock.filter_log_events.call_count == 1
@@ -82,8 +85,9 @@ def test_check_sms_failure(notify_api, mocker):
)
message_id = "fail"
notification_id = "bbb"
created_at = datetime.utcnow()
with notify_api.app_context():
aws_cloudwatch_client.check_sms(message_id, notification_id, 1000000000000)
aws_cloudwatch_client.check_sms(message_id, notification_id, created_at)
# We check the 'success' log group and find nothing, so we then check the 'fail' log group -- two calls.
assert boto_mock.filter_log_events.call_count == 2