Merge pull request #1226 from alphagov/backfill-perf-stats

Backfill perf stats
This commit is contained in:
Leo Hemsted
2017-09-05 16:55:43 +01:00
committed by GitHub
4 changed files with 79 additions and 29 deletions

View File

@@ -0,0 +1,14 @@
from datetime import datetime
from app.commands import BackfillProcessingTime
def test_backfill_processing_time_works_for_correct_dates(mocker):
send_mock = mocker.patch('app.commands.send_processing_time_for_start_and_end')
BackfillProcessingTime().run('2017-08-01', '2017-08-03')
assert send_mock.call_count == 3
send_mock.assert_any_call(datetime(2017, 7, 31, 23, 0), datetime(2017, 8, 1, 23, 0))
send_mock.assert_any_call(datetime(2017, 8, 1, 23, 0), datetime(2017, 8, 2, 23, 0))
send_mock.assert_any_call(datetime(2017, 8, 2, 23, 0), datetime(2017, 8, 3, 23, 0))