mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
pycodestyle
This commit is contained in:
@@ -25,6 +25,7 @@ def send_total_notifications_sent_for_day_stats(date, channel, count, period):
|
|||||||
payload=payload
|
payload=payload
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_total_sent_notifications_yesterday():
|
def get_total_sent_notifications_yesterday():
|
||||||
today = datetime.utcnow()
|
today = datetime.utcnow()
|
||||||
start_date = get_midnight_for_day_before(today)
|
start_date = get_midnight_for_day_before(today)
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ def test_will_remove_csv_files_for_jobs_older_than_seven_days(
|
|||||||
|
|
||||||
|
|
||||||
def test_send_daily_performance_stats_calls_does_not_send_if_inactive(mocker):
|
def test_send_daily_performance_stats_calls_does_not_send_if_inactive(mocker):
|
||||||
send_mock = mocker.patch('app.celery.scheduled_tasks.total_sent_notifications.send_total_notifications_sent_for_day_stats')
|
send_mock = mocker.patch('app.celery.scheduled_tasks.total_sent_notifications.send_total_notifications_sent_for_day_stats') # noqa
|
||||||
|
|
||||||
with patch.object(
|
with patch.object(
|
||||||
PerformancePlatformClient,
|
PerformancePlatformClient,
|
||||||
@@ -291,7 +291,7 @@ def test_send_daily_performance_stats_calls_with_correct_totals(
|
|||||||
sample_template,
|
sample_template,
|
||||||
mocker
|
mocker
|
||||||
):
|
):
|
||||||
perf_mock = mocker.patch('app.celery.scheduled_tasks.total_sent_notifications.send_total_notifications_sent_for_day_stats')
|
perf_mock = mocker.patch('app.celery.scheduled_tasks.total_sent_notifications.send_total_notifications_sent_for_day_stats') # noqa
|
||||||
|
|
||||||
notification_history = partial(
|
notification_history = partial(
|
||||||
create_notification_history,
|
create_notification_history,
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ def test_should_not_call_if_not_enabled(perf_client):
|
|||||||
assert request_mock.called is False
|
assert request_mock.called is False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_should_call_if_enabled(perf_client):
|
def test_should_call_if_enabled(perf_client):
|
||||||
with requests_mock.Mocker() as request_mock:
|
with requests_mock.Mocker() as request_mock:
|
||||||
request_mock.post('https://performance-platform-url/foo', json={}, status_code=200)
|
request_mock.post('https://performance-platform-url/foo', json={}, status_code=200)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from functools import partial
|
|||||||
from freezegun import freeze_time
|
from freezegun import freeze_time
|
||||||
|
|
||||||
from app.utils import get_midnight_for_day_before
|
from app.utils import get_midnight_for_day_before
|
||||||
from app.performance_platform.total_sent_notifications import(
|
from app.performance_platform.total_sent_notifications import (
|
||||||
send_total_notifications_sent_for_day_stats,
|
send_total_notifications_sent_for_day_stats,
|
||||||
get_total_sent_notifications_yesterday
|
get_total_sent_notifications_yesterday
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ def redis_config():
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def performance_platform_config():
|
def performance_platform_config():
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user