Skip to content

Commit ac65c8f

Browse files
chore(internal): update client tests
1 parent 2d59ed0 commit ac65c8f

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

tests/test_client.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
from isaacus import Isaacus, AsyncIsaacus, APIResponseValidationError
2525
from isaacus._types import Omit
26+
from isaacus._utils import maybe_transform
2627
from isaacus._models import BaseModel, FinalRequestOptions
2728
from isaacus._constants import RAW_RESPONSE_HEADER
2829
from isaacus._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError
@@ -32,6 +33,7 @@
3233
BaseClient,
3334
make_request_options,
3435
)
36+
from isaacus.types.classify_universal_create_params import ClassifyUniversalCreateParams
3537

3638
from .utils import update_env
3739

@@ -677,7 +679,10 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
677679
with pytest.raises(APITimeoutError):
678680
self.client.post(
679681
"/classify/universal",
680-
body=cast(object, dict(model="model", query="query", text="text")),
682+
body=cast(
683+
object,
684+
maybe_transform(dict(model="model", query="query", text="text"), ClassifyUniversalCreateParams),
685+
),
681686
cast_to=httpx.Response,
682687
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
683688
)
@@ -692,7 +697,10 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
692697
with pytest.raises(APIStatusError):
693698
self.client.post(
694699
"/classify/universal",
695-
body=cast(object, dict(model="model", query="query", text="text")),
700+
body=cast(
701+
object,
702+
maybe_transform(dict(model="model", query="query", text="text"), ClassifyUniversalCreateParams),
703+
),
696704
cast_to=httpx.Response,
697705
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
698706
)
@@ -1408,7 +1416,10 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
14081416
with pytest.raises(APITimeoutError):
14091417
await self.client.post(
14101418
"/classify/universal",
1411-
body=cast(object, dict(model="model", query="query", text="text")),
1419+
body=cast(
1420+
object,
1421+
maybe_transform(dict(model="model", query="query", text="text"), ClassifyUniversalCreateParams),
1422+
),
14121423
cast_to=httpx.Response,
14131424
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
14141425
)
@@ -1423,7 +1434,10 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
14231434
with pytest.raises(APIStatusError):
14241435
await self.client.post(
14251436
"/classify/universal",
1426-
body=cast(object, dict(model="model", query="query", text="text")),
1437+
body=cast(
1438+
object,
1439+
maybe_transform(dict(model="model", query="query", text="text"), ClassifyUniversalCreateParams),
1440+
),
14271441
cast_to=httpx.Response,
14281442
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
14291443
)

0 commit comments

Comments
 (0)