From 412c87cfc8aeece522096a7541b65139383cd2db Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Thu, 24 Aug 2017 10:52:47 +0100 Subject: [PATCH] pycodestyle --- app/performance_platform/total_sent_notifications.py | 1 + tests/app/celery/test_scheduled_tasks.py | 4 ++-- tests/app/clients/test_performance_platform.py | 1 - .../app/performance_platform/test_total_sent_notifications.py | 2 +- tests/app/test_cloudfoundry_config.py | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/performance_platform/total_sent_notifications.py b/app/performance_platform/total_sent_notifications.py index 774f300e6..9f455f113 100644 --- a/app/performance_platform/total_sent_notifications.py +++ b/app/performance_platform/total_sent_notifications.py @@ -25,6 +25,7 @@ def send_total_notifications_sent_for_day_stats(date, channel, count, period): payload=payload ) + def get_total_sent_notifications_yesterday(): today = datetime.utcnow() start_date = get_midnight_for_day_before(today) diff --git a/tests/app/celery/test_scheduled_tasks.py b/tests/app/celery/test_scheduled_tasks.py index d05423e00..6064f1c79 100644 --- a/tests/app/celery/test_scheduled_tasks.py +++ b/tests/app/celery/test_scheduled_tasks.py @@ -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): - 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( PerformancePlatformClient, @@ -291,7 +291,7 @@ def test_send_daily_performance_stats_calls_with_correct_totals( sample_template, 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( create_notification_history, diff --git a/tests/app/clients/test_performance_platform.py b/tests/app/clients/test_performance_platform.py index 77bfad9d8..aba87b9e7 100644 --- a/tests/app/clients/test_performance_platform.py +++ b/tests/app/clients/test_performance_platform.py @@ -29,7 +29,6 @@ def test_should_not_call_if_not_enabled(perf_client): assert request_mock.called is False - def test_should_call_if_enabled(perf_client): with requests_mock.Mocker() as request_mock: request_mock.post('https://performance-platform-url/foo', json={}, status_code=200) diff --git a/tests/app/performance_platform/test_total_sent_notifications.py b/tests/app/performance_platform/test_total_sent_notifications.py index 04226b263..12125d9c0 100644 --- a/tests/app/performance_platform/test_total_sent_notifications.py +++ b/tests/app/performance_platform/test_total_sent_notifications.py @@ -4,7 +4,7 @@ from functools import partial from freezegun import freeze_time 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, get_total_sent_notifications_yesterday ) diff --git a/tests/app/test_cloudfoundry_config.py b/tests/app/test_cloudfoundry_config.py index c299976d9..72b2f2865 100644 --- a/tests/app/test_cloudfoundry_config.py +++ b/tests/app/test_cloudfoundry_config.py @@ -86,6 +86,7 @@ def redis_config(): } } + @pytest.fixture def performance_platform_config(): return {