more tests

This commit is contained in:
Kenneth Kehl
2025-01-13 13:03:50 -08:00
parent 1ea89ab616
commit f4b8c040a3
2 changed files with 6 additions and 3 deletions

View File

@@ -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:

View File

@@ -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)