mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
more tests
This commit is contained in:
@@ -267,14 +267,20 @@ def process_delivery_receipts(self):
|
|||||||
)
|
)
|
||||||
print(f"DELIVERED {delivered_receipts} FAILED {failed_receipts}")
|
print(f"DELIVERED {delivered_receipts} FAILED {failed_receipts}")
|
||||||
delivered_receipts = list(delivered_receipts)
|
delivered_receipts = list(delivered_receipts)
|
||||||
|
print(f"DELIVERED LIST {delivered_receipts}")
|
||||||
for i in range(0, len(delivered_receipts), batch_size):
|
for i in range(0, len(delivered_receipts), batch_size):
|
||||||
batch = delivered_receipts[i : i + batch_size]
|
batch = delivered_receipts[i : i + batch_size]
|
||||||
|
print("UPDATING DELIVERY RECEIPTS")
|
||||||
dao_update_delivery_receipts(batch, True)
|
dao_update_delivery_receipts(batch, True)
|
||||||
|
print("DEIVERY RECEIPTS UPDATED")
|
||||||
failed_receipts = list(failed_receipts)
|
failed_receipts = list(failed_receipts)
|
||||||
for i in range(0, len(failed_receipts), batch_size):
|
for i in range(0, len(failed_receipts), batch_size):
|
||||||
|
print("UDPATING FAILED RECEIPTS")
|
||||||
batch = failed_receipts[i : i + batch_size]
|
batch = failed_receipts[i : i + batch_size]
|
||||||
dao_update_delivery_receipts(batch, False)
|
dao_update_delivery_receipts(batch, False)
|
||||||
|
print("FAILED RECEITPS UPDATED")
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
print(f"EXCEPTION {ex}")
|
||||||
retry_count = self.request.retries
|
retry_count = self.request.retries
|
||||||
wait_time = 3600 * 2**retry_count
|
wait_time = 3600 * 2**retry_count
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -618,9 +618,6 @@ def test_process_delivery_receipts_success(mocker):
|
|||||||
processor.retry = MagicMock()
|
processor.retry = MagicMock()
|
||||||
|
|
||||||
processor.process_delivery_receipts()
|
processor.process_delivery_receipts()
|
||||||
|
|
||||||
cloudwatch_mock.check_delivery_receipts.assert_called_once()
|
|
||||||
|
|
||||||
assert dao_update_mock.call_count == 3
|
assert dao_update_mock.call_count == 3
|
||||||
dao_update_mock.assert_any_call(list(range(1000)), True)
|
dao_update_mock.assert_any_call(list(range(1000)), True)
|
||||||
dao_update_mock.assert_any_call(list(range(1000, 2000)), True)
|
dao_update_mock.assert_any_call(list(range(1000, 2000)), True)
|
||||||
|
|||||||
Reference in New Issue
Block a user