Skip to content

Commit 130f410

Browse files
author
Sam Park
committed
Update tests
1 parent 97a66ae commit 130f410

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/braze/test_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from braze.client import MAX_WAIT_SECONDS
88
from freezegun import freeze_time
99
import pytest
10+
from pytest import approx
1011
from requests import RequestException
1112
from requests_mock import ANY
1213
from tenacity import Future
@@ -148,6 +149,7 @@ def test_retries_for_rate_limit_errors(
148149
purchases,
149150
reset_delta_seconds,
150151
expected_attempts,
152+
no_sleep,
151153
):
152154
headers = {
153155
"Content-Type": "application/json",
@@ -165,3 +167,7 @@ def test_retries_for_rate_limit_errors(
165167
assert stats["attempt_number"] == expected_attempts
166168
assert response["success"] is False
167169
assert "BrazeRateLimitError" in response["errors"]
170+
171+
# Ensure the correct wait time is used when rate limited
172+
for i in range(expected_attempts - 1):
173+
assert approx(no_sleep.call_args_list[i][0], reset_delta_seconds)

0 commit comments

Comments
 (0)