File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 77from braze .client import MAX_WAIT_SECONDS
88from freezegun import freeze_time
99import pytest
10+ from pytest import approx
1011from requests import RequestException
1112from requests_mock import ANY
1213from 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 )
You can’t perform that action at this time.
0 commit comments