Skip to content

Commit a704177

Browse files
committed
chore(internal): remove redundant client test (#142)
1 parent 7de4d9e commit a704177

1 file changed

Lines changed: 0 additions & 39 deletions

File tree

tests/test_client.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from orb import Orb, AsyncOrb, APIResponseValidationError
2020
from orb._client import Orb, AsyncOrb
2121
from orb._models import BaseModel, FinalRequestOptions
22-
from orb._response import APIResponse, AsyncAPIResponse
2322
from orb._constants import RAW_RESPONSE_HEADER
2423
from orb._exceptions import OrbError, APIStatusError, APITimeoutError, APIResponseValidationError
2524
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
676675
calculated = client._calculate_retry_timeout(remaining_retries, options, headers)
677676
assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType]
678677

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-
698678
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
699679
@pytest.mark.respx(base_url=base_url)
700680
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
13701350
calculated = client._calculate_retry_timeout(remaining_retries, options, headers)
13711351
assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType]
13721352

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-
13921353
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
13931354
@pytest.mark.respx(base_url=base_url)
13941355
async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:

0 commit comments

Comments
 (0)