mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-26 14:48:31 -04:00
add migration for e2e tests and improve code coverage
This commit is contained in:
@@ -5,7 +5,7 @@ from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||
|
||||
import app
|
||||
from app.dao import templates_dao
|
||||
from app.models import EMAIL_TYPE, SMS_TYPE
|
||||
from app.models import EMAIL_TYPE, KEY_TYPE_NORMAL, SMS_TYPE
|
||||
from app.notifications.process_notifications import create_content_for_notification
|
||||
from app.notifications.sns_cert_validator import (
|
||||
VALID_SNS_TOPICS,
|
||||
@@ -21,6 +21,7 @@ from app.notifications.validators import (
|
||||
check_reply_to,
|
||||
check_service_email_reply_to_id,
|
||||
check_service_over_api_rate_limit,
|
||||
check_service_over_total_message_limit,
|
||||
check_service_sms_sender_id,
|
||||
check_template_is_active,
|
||||
check_template_is_for_notification_type,
|
||||
@@ -727,3 +728,12 @@ def test_get_string_to_sign():
|
||||
# This is a test payload with no valid cert, so it should raise a ValueError
|
||||
with pytest.raises(ValueError):
|
||||
validate_sns_cert(sns_payload)
|
||||
|
||||
|
||||
def test_check_service_over_total_message_limit(mocker, sample_service):
|
||||
get_redis_mock = mocker.patch("app.notifications.validators.redis_store.get")
|
||||
get_redis_mock.return_value = None
|
||||
service_stats = check_service_over_total_message_limit(
|
||||
KEY_TYPE_NORMAL, sample_service
|
||||
)
|
||||
assert service_stats == 0
|
||||
|
||||
Reference in New Issue
Block a user