mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-23 07:46:06 -04:00
fix tests
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
from flask import current_app
|
||||||
|
|
||||||
from app import get_aws_sns_client
|
from app import get_aws_sns_client
|
||||||
|
|
||||||
@@ -9,6 +10,7 @@ def test_send_sms_successful_returns_aws_sns_response(notify_api, mocker):
|
|||||||
content = reference = "foo"
|
content = reference = "foo"
|
||||||
with notify_api.app_context():
|
with notify_api.app_context():
|
||||||
aws_sns_client = get_aws_sns_client()
|
aws_sns_client = get_aws_sns_client()
|
||||||
|
aws_sns_client.init_app(current_app)
|
||||||
boto_mock = mocker.patch.object(aws_sns_client, "_client", create=True)
|
boto_mock = mocker.patch.object(aws_sns_client, "_client", create=True)
|
||||||
aws_sns_client.send_sms(to, content, reference)
|
aws_sns_client.send_sms(to, content, reference)
|
||||||
boto_mock.publish.assert_called_once_with(
|
boto_mock.publish.assert_called_once_with(
|
||||||
@@ -32,6 +34,7 @@ def test_send_sms_returns_raises_error_if_there_is_no_valid_number_is_found(
|
|||||||
):
|
):
|
||||||
with notify_api.app_context():
|
with notify_api.app_context():
|
||||||
aws_sns_client = get_aws_sns_client()
|
aws_sns_client = get_aws_sns_client()
|
||||||
|
aws_sns_client.init_app(current_app)
|
||||||
mocker.patch.object(aws_sns_client, "_client", create=True)
|
mocker.patch.object(aws_sns_client, "_client", create=True)
|
||||||
to = ""
|
to = ""
|
||||||
content = reference = "foo"
|
content = reference = "foo"
|
||||||
|
|||||||
Reference in New Issue
Block a user