mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
notify-243 remove statsd
This commit is contained in:
@@ -57,7 +57,6 @@ def test_should_be_none_if_unrecognised_status_code():
|
||||
], ids=['empty', 'single_email', 'punycode'])
|
||||
def test_send_email_handles_reply_to_address(notify_api, mocker, reply_to_address, expected_value):
|
||||
boto_mock = mocker.patch.object(aws_ses_client, '_client', create=True)
|
||||
mocker.patch.object(aws_ses_client, 'statsd_client', create=True)
|
||||
|
||||
with notify_api.app_context():
|
||||
aws_ses_client.send_email(
|
||||
@@ -78,7 +77,6 @@ def test_send_email_handles_reply_to_address(notify_api, mocker, reply_to_addres
|
||||
|
||||
def test_send_email_handles_punycode_to_address(notify_api, mocker):
|
||||
boto_mock = mocker.patch.object(aws_ses_client, '_client', create=True)
|
||||
mocker.patch.object(aws_ses_client, 'statsd_client', create=True)
|
||||
|
||||
with notify_api.app_context():
|
||||
aws_ses_client.send_email(
|
||||
@@ -98,7 +96,6 @@ def test_send_email_handles_punycode_to_address(notify_api, mocker):
|
||||
|
||||
def test_send_email_raises_invalid_parameter_value_error_as_EmailClientNonRetryableException(mocker):
|
||||
boto_mock = mocker.patch.object(aws_ses_client, '_client', create=True)
|
||||
mocker.patch.object(aws_ses_client, 'statsd_client', create=True)
|
||||
error_response = {
|
||||
'Error': {
|
||||
'Code': 'InvalidParameterValue',
|
||||
@@ -107,7 +104,6 @@ def test_send_email_raises_invalid_parameter_value_error_as_EmailClientNonRetrya
|
||||
}
|
||||
}
|
||||
boto_mock.send_email.side_effect = botocore.exceptions.ClientError(error_response, 'opname')
|
||||
mocker.patch.object(aws_ses_client, 'statsd_client', create=True)
|
||||
|
||||
with pytest.raises(EmailClientNonRetryableException) as excinfo:
|
||||
aws_ses_client.send_email(
|
||||
@@ -122,7 +118,6 @@ def test_send_email_raises_invalid_parameter_value_error_as_EmailClientNonRetrya
|
||||
|
||||
def test_send_email_raises_send_rate_throttling_as_AwsSesClientThrottlingSendRateException(mocker):
|
||||
boto_mock = mocker.patch.object(aws_ses_client, '_client', create=True)
|
||||
mocker.patch.object(aws_ses_client, 'statsd_client', create=True)
|
||||
error_response = {
|
||||
'Error': {
|
||||
'Code': 'Throttling',
|
||||
@@ -143,7 +138,6 @@ def test_send_email_raises_send_rate_throttling_as_AwsSesClientThrottlingSendRat
|
||||
|
||||
def test_send_email_does_not_raise_AwsSesClientThrottlingSendRateException_if_non_send_rate_throttling(mocker):
|
||||
boto_mock = mocker.patch.object(aws_ses_client, '_client', create=True)
|
||||
mocker.patch.object(aws_ses_client, 'statsd_client', create=True)
|
||||
error_response = {
|
||||
'Error': {
|
||||
'Code': 'Throttling',
|
||||
@@ -164,7 +158,6 @@ def test_send_email_does_not_raise_AwsSesClientThrottlingSendRateException_if_no
|
||||
|
||||
def test_send_email_raises_other_errs_as_AwsSesClientException(mocker):
|
||||
boto_mock = mocker.patch.object(aws_ses_client, '_client', create=True)
|
||||
mocker.patch.object(aws_ses_client, 'statsd_client', create=True)
|
||||
error_response = {
|
||||
'Error': {
|
||||
'Code': 'ServiceUnavailable',
|
||||
@@ -173,7 +166,6 @@ def test_send_email_raises_other_errs_as_AwsSesClientException(mocker):
|
||||
}
|
||||
}
|
||||
boto_mock.send_email.side_effect = botocore.exceptions.ClientError(error_response, 'opname')
|
||||
mocker.patch.object(aws_ses_client, 'statsd_client', create=True)
|
||||
|
||||
with pytest.raises(AwsSesClientException) as excinfo:
|
||||
aws_ses_client.send_email(
|
||||
|
||||
@@ -5,7 +5,6 @@ from app import aws_sns_client
|
||||
|
||||
def test_send_sms_successful_returns_aws_sns_response(notify_api, mocker):
|
||||
boto_mock = mocker.patch.object(aws_sns_client, '_client', create=True)
|
||||
mocker.patch.object(aws_sns_client, 'statsd_client', create=True)
|
||||
to = "6135555555"
|
||||
content = reference = 'foo'
|
||||
with notify_api.app_context():
|
||||
@@ -22,7 +21,6 @@ def test_send_sms_successful_returns_aws_sns_response(notify_api, mocker):
|
||||
|
||||
def test_send_sms_returns_raises_error_if_there_is_no_valid_number_is_found(notify_api, mocker):
|
||||
mocker.patch.object(aws_sns_client, '_client', create=True)
|
||||
mocker.patch.object(aws_sns_client, 'statsd_client', create=True)
|
||||
to = ""
|
||||
content = reference = 'foo'
|
||||
with pytest.raises(ValueError) as excinfo:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import pytest
|
||||
|
||||
from app import statsd_client
|
||||
from app.clients.sms import SmsClient, SmsClientResponseException
|
||||
|
||||
|
||||
@@ -12,7 +11,7 @@ def fake_client(notify_api):
|
||||
return 'fake'
|
||||
|
||||
fake_client = FakeSmsClient()
|
||||
fake_client.init_app(notify_api, statsd_client)
|
||||
# fake_client.init_app(notify_api)
|
||||
return fake_client
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user