Skip to content

Commit 30307f4

Browse files
chore(internal): update client tests (#545)
1 parent 5c44e84 commit 30307f4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/test_client.py

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

2424
from runloop_api_client import Runloop, AsyncRunloop, APIResponseValidationError
2525
from runloop_api_client._types import Omit
26+
from runloop_api_client._utils import maybe_transform
2627
from runloop_api_client._models import BaseModel, FinalRequestOptions
2728
from runloop_api_client._constants import RAW_RESPONSE_HEADER
2829
from runloop_api_client._exceptions import RunloopError, APIStatusError, APITimeoutError, APIResponseValidationError
@@ -32,6 +33,7 @@
3233
BaseClient,
3334
make_request_options,
3435
)
36+
from runloop_api_client.types.devbox_create_params import DevboxCreateParams
3537

3638
from .utils import update_env
3739

@@ -772,7 +774,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
772774
with pytest.raises(APITimeoutError):
773775
self.client.post(
774776
"/v1/devboxes",
775-
body=cast(object, dict()),
777+
body=cast(object, maybe_transform(dict(), DevboxCreateParams)),
776778
cast_to=httpx.Response,
777779
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
778780
)
@@ -787,7 +789,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
787789
with pytest.raises(APIStatusError):
788790
self.client.post(
789791
"/v1/devboxes",
790-
body=cast(object, dict()),
792+
body=cast(object, maybe_transform(dict(), DevboxCreateParams)),
791793
cast_to=httpx.Response,
792794
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
793795
)
@@ -1593,7 +1595,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
15931595
with pytest.raises(APITimeoutError):
15941596
await self.client.post(
15951597
"/v1/devboxes",
1596-
body=cast(object, dict()),
1598+
body=cast(object, maybe_transform(dict(), DevboxCreateParams)),
15971599
cast_to=httpx.Response,
15981600
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
15991601
)
@@ -1608,7 +1610,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
16081610
with pytest.raises(APIStatusError):
16091611
await self.client.post(
16101612
"/v1/devboxes",
1611-
body=cast(object, dict()),
1613+
body=cast(object, maybe_transform(dict(), DevboxCreateParams)),
16121614
cast_to=httpx.Response,
16131615
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
16141616
)

0 commit comments

Comments
 (0)