(
self, remaining_retries: int, retry_after: str, timeout: float, client: OpenAI
)
| 1098 | ) |
| 1099 | @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) |
| 1100 | def test_parse_retry_after_header( |
| 1101 | self, remaining_retries: int, retry_after: str, timeout: float, client: OpenAI |
| 1102 | ) -> None: |
| 1103 | headers = httpx.Headers({"retry-after": retry_after}) |
| 1104 | options = FinalRequestOptions(method="get", url="/foo", max_retries=3) |
| 1105 | calculated = client._calculate_retry_timeout(remaining_retries, options, headers) |
| 1106 | assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] |
| 1107 | |
| 1108 | @mock.patch("openai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) |
| 1109 | @pytest.mark.respx(base_url=base_url) |
nothing calls this directly
no test coverage detected