MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / test_secondary_rate_error_with_reset

Method test_secondary_rate_error_with_reset

tests/GithubRetry.py:239–265  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

237 test_increment(retry, response(), expect_retry_error=True)
238
239 def test_secondary_rate_error_with_reset(self):
240 retry = github.GithubRetry(total=3)
241 response = self.response_func(SecondaryRateLimitJson, 1644768012)
242 test_increment = self.get_test_increment_func(SecondaryRateLimitMessage)
243
244 # test 12 seconds before reset, expect secondary wait seconds of 60
245 with self.mock_retry_now(1644768000):
246 retry = test_increment(
247 retry,
248 response(),
249 expected_total=2,
250 expected_backoff=60,
251 has_reset=False,
252 )
253 with self.mock_retry_now(1644768000):
254 retry = test_increment(
255 retry,
256 response(),
257 expected_total=1,
258 expected_backoff=60,
259 has_reset=False,
260 )
261
262 # test 2 seconds after reset, still expect secondary wait seconds of 60
263 with self.mock_retry_now(1644768014):
264 retry = test_increment(retry, response(), expected_total=0, expected_backoff=60)
265 test_increment(retry, response(), expect_retry_error=True)
266
267 def test_secondary_rate_error_with_reset_and_exponential_backoff(self):
268 retry = github.GithubRetry(total=3, backoff_factor=10, secondary_rate_wait=15)

Callers

nothing calls this directly

Calls 3

response_funcMethod · 0.95
mock_retry_nowMethod · 0.95

Tested by

no test coverage detected