Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

test(sdk-python): pin an explicit empty ids list in a webhook redrive

Yudhi Armyndharis58e29448e2ad
diff --git a/sdk/python/tests/test_sdk.py b/sdk/python/tests/test_sdk.py
index 7bf844a80..47cdb13a7 100644
--- a/sdk/python/tests/test_sdk.py
+++ b/sdk/python/tests/test_sdk.py
@@ -837,6 +837,13 @@ class TestWebhooks:
client.webhooks.redrive_delivery_failures()
assert backend.last_call.body == {}
+ def test_redrive_delivery_failures_keeps_an_explicit_empty_ids_list(self):
+ # The gateway reads ids: [] as "replay nothing" and an omitted ids as "replay up to 100 rows".
+ result = {"redriven": 0, "delivered": 0, "enqueued": 0, "failed": 0, "skipped": 0, "remaining": 3}
+ backend = MockBackend().on("POST", "/api/webhooks/delivery-failures/redrive", body=result)
+ make_client(backend).webhooks.redrive_delivery_failures({"ids": []})
+ assert backend.last_call.body == {"ids": []}
+
class TestStatus:
def test_send_image_video_forward_nested_media_body(self):