(self)
| 313 | assert "Caused by redirect" not in str(e.value) |
| 314 | |
| 315 | def test_history(self) -> None: |
| 316 | retry = Retry(total=10, allowed_methods=frozenset(["GET", "POST"])) |
| 317 | assert retry.history == tuple() |
| 318 | connection_error = ConnectTimeoutError("conntimeout") |
| 319 | retry = retry.increment("GET", "/test1", None, connection_error) |
| 320 | test_history1 = (RequestHistory("GET", "/test1", connection_error, None, None),) |
| 321 | assert retry.history == test_history1 |
| 322 | |
| 323 | read_error = ReadTimeoutError(DUMMY_POOL, "/test2", "read timed out") |
| 324 | retry = retry.increment("POST", "/test2", None, read_error) |
| 325 | test_history2 = ( |
| 326 | RequestHistory("GET", "/test1", connection_error, None, None), |
| 327 | RequestHistory("POST", "/test2", read_error, None, None), |
| 328 | ) |
| 329 | assert retry.history == test_history2 |
| 330 | |
| 331 | response = HTTPResponse(status=500) |
| 332 | retry = retry.increment("GET", "/test3", response, None) |
| 333 | test_history3 = ( |
| 334 | RequestHistory("GET", "/test1", connection_error, None, None), |
| 335 | RequestHistory("POST", "/test2", read_error, None, None), |
| 336 | RequestHistory("GET", "/test3", None, 500, None), |
| 337 | ) |
| 338 | assert retry.history == test_history3 |
| 339 | |
| 340 | def test_retry_method_not_allowed(self) -> None: |
| 341 | error = ReadTimeoutError(DUMMY_POOL, "/", "read timed out") |
nothing calls this directly
no test coverage detected