refactor performance platform code

so that it doesn't appear generic when it's actually specific to
sending the daily notification totals. To do this, split it out into a
separate performance_platform directory, containing the business logic,
and make the performance_platform_client incredibly thin - all it
handles is adding ids to payloads, and sending stats.

Also, some changes to the config (not all done yet) since there is one
token per endpoint, not one for the whole platform as we'd previously
coded
This commit is contained in:
Leo Hemsted
2017-08-23 15:04:37 +01:00
parent 3794722203
commit 89f4f5173e
8 changed files with 193 additions and 166 deletions

View File

@@ -276,7 +276,7 @@ def test_send_daily_performance_stats_calls_does_not_send_if_inactive(
sample_template,
mocker
):
send_mock = mocker.patch('app.celery.scheduled_tasks.performance_platform_client.send_performance_stats')
send_mock = mocker.patch('app.celery.scheduled_tasks.total_sent_notifications.send_total_notifications_sent_for_day_stats')
with patch.object(
PerformancePlatformClient,
@@ -296,7 +296,7 @@ def test_send_daily_performance_stats_calls_with_correct_totals(
sample_template,
mocker
):
perf_mock = mocker.patch('app.celery.scheduled_tasks.performance_platform_client.send_performance_stats')
perf_mock = mocker.patch('app.celery.scheduled_tasks.total_sent_notifications.send_total_notifications_sent_for_day_stats')
notification_history = partial(
create_notification_history,