|
19 | 19 | from orb import Orb, AsyncOrb, APIResponseValidationError |
20 | 20 | from orb._client import Orb, AsyncOrb |
21 | 21 | from orb._models import BaseModel, FinalRequestOptions |
22 | | -from orb._response import APIResponse, AsyncAPIResponse |
23 | 22 | from orb._constants import RAW_RESPONSE_HEADER |
24 | 23 | from orb._exceptions import OrbError, APIStatusError, APITimeoutError, APIResponseValidationError |
25 | 24 | from orb._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, make_request_options |
@@ -676,25 +675,6 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str |
676 | 675 | calculated = client._calculate_retry_timeout(remaining_retries, options, headers) |
677 | 676 | assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] |
678 | 677 |
|
679 | | - @mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) |
680 | | - @pytest.mark.respx(base_url=base_url) |
681 | | - def test_streaming_response(self) -> None: |
682 | | - response = self.client.post( |
683 | | - "/customers", |
684 | | - body=dict(email="example-customer@withorb.com", name="My Customer"), |
685 | | - cast_to=APIResponse[bytes], |
686 | | - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, |
687 | | - ) |
688 | | - |
689 | | - assert not cast(Any, response.is_closed) |
690 | | - assert _get_open_connections(self.client) == 1 |
691 | | - |
692 | | - for _ in response.iter_bytes(): |
693 | | - ... |
694 | | - |
695 | | - assert cast(Any, response.is_closed) |
696 | | - assert _get_open_connections(self.client) == 0 |
697 | | - |
698 | 678 | @mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) |
699 | 679 | @pytest.mark.respx(base_url=base_url) |
700 | 680 | def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: |
@@ -1370,25 +1350,6 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte |
1370 | 1350 | calculated = client._calculate_retry_timeout(remaining_retries, options, headers) |
1371 | 1351 | assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] |
1372 | 1352 |
|
1373 | | - @mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) |
1374 | | - @pytest.mark.respx(base_url=base_url) |
1375 | | - async def test_streaming_response(self) -> None: |
1376 | | - response = await self.client.post( |
1377 | | - "/customers", |
1378 | | - body=dict(email="example-customer@withorb.com", name="My Customer"), |
1379 | | - cast_to=AsyncAPIResponse[bytes], |
1380 | | - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, |
1381 | | - ) |
1382 | | - |
1383 | | - assert not cast(Any, response.is_closed) |
1384 | | - assert _get_open_connections(self.client) == 1 |
1385 | | - |
1386 | | - async for _ in response.iter_bytes(): |
1387 | | - ... |
1388 | | - |
1389 | | - assert cast(Any, response.is_closed) |
1390 | | - assert _get_open_connections(self.client) == 0 |
1391 | | - |
1392 | 1353 | @mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) |
1393 | 1354 | @pytest.mark.respx(base_url=base_url) |
1394 | 1355 | async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: |
|
0 commit comments