mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
add batch task to backfill processing time data
give it a start date and an end date, and it'll send data to the performance platform for all dates in that (inclusive)
This commit is contained in:
13
tests/app/test_commands.py
Normal file
13
tests/app/test_commands.py
Normal file
@@ -0,0 +1,13 @@
|
||||
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))
|
||||
Reference in New Issue
Block a user