MCPcopy
hub / github.com/urllib3/urllib3 / test_status_forcelist

Method test_status_forcelist

test/test_retry.py:251–263  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

249 retry.sleep()
250
251 def test_status_forcelist(self) -> None:
252 retry = Retry(status_forcelist=range(500, 600))
253 assert not retry.is_retry("GET", status_code=200)
254 assert not retry.is_retry("GET", status_code=400)
255 assert retry.is_retry("GET", status_code=500)
256
257 retry = Retry(total=1, status_forcelist=[418])
258 assert not retry.is_retry("GET", status_code=400)
259 assert retry.is_retry("GET", status_code=418)
260
261 # String status codes are not matched.
262 retry = Retry(total=1, status_forcelist=["418"]) # type: ignore[list-item]
263 assert not retry.is_retry("GET", status_code=418)
264
265 def test_allowed_methods_with_status_forcelist(self) -> None:
266 # Falsey allowed_methods means to retry on any method.

Callers

nothing calls this directly

Calls 2

is_retryMethod · 0.95
RetryClass · 0.90

Tested by

no test coverage detected