mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 16:01:15 -05:00
more tests
This commit is contained in:
@@ -3,6 +3,7 @@ from unittest.mock import ANY, call
|
||||
|
||||
import pytest
|
||||
from freezegun import freeze_time
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from app.celery import nightly_tasks
|
||||
from app.celery.nightly_tasks import (
|
||||
@@ -148,6 +149,14 @@ def test_delete_inbound_sms_calls_child_task(notify_api, mocker):
|
||||
assert nightly_tasks.delete_inbound_sms_older_than_retention.call_count == 1
|
||||
|
||||
|
||||
def test_delete_inbound_sms_calls_child_task_db_error(notify_api, mocker):
|
||||
mock_delete = mocker.patch('app.celery.nightly_tasks.delete_inbound_sms_older_than_retention')
|
||||
mock_delete.side_effect = SQLAlchemyError
|
||||
|
||||
with pytest.raises(expected_exception=SQLAlchemyError):
|
||||
delete_inbound_sms()
|
||||
|
||||
|
||||
@freeze_time('2021-01-18T02:00')
|
||||
@pytest.mark.parametrize('date_provided', [None, '2021-1-17'])
|
||||
def test_save_daily_notification_processing_time(mocker, sample_template, date_provided):
|
||||
@@ -316,6 +325,10 @@ def test_delete_notifications_task_calls_task_for_services_that_have_sent_notifi
|
||||
])
|
||||
|
||||
|
||||
def delete_notifications_by_service_and_type(id, param, param1):
|
||||
pass
|
||||
|
||||
|
||||
def test_cleanup_unfinished_jobs(mocker):
|
||||
mock_s3 = mocker.patch('app.celery.nightly_tasks.remove_csv_object')
|
||||
mock_dao_archive = mocker.patch('app.celery.nightly_tasks.dao_archive_job')
|
||||
|
||||
Reference in New Issue
Block a user