From 1defbdf77750fc83f99cccc03d4705b99f0d473e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 03:06:48 +0000 Subject: [PATCH] chore(internal): update client tests --- tests/test_client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 9031a120..686afa13 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -23,6 +23,7 @@ from asktable import Asktable, AsyncAsktable, APIResponseValidationError from asktable._types import Omit +from asktable._utils import maybe_transform from asktable._models import BaseModel, FinalRequestOptions from asktable._constants import RAW_RESPONSE_HEADER from asktable._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError @@ -32,6 +33,7 @@ BaseClient, make_request_options, ) +from asktable.types.datasource_create_params import DatasourceCreateParams from .utils import update_env @@ -707,7 +709,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No with pytest.raises(APITimeoutError): self.client.post( "/datasources", - body=cast(object, dict(engine="mysql")), + body=cast(object, maybe_transform(dict(engine="mysql"), DatasourceCreateParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -722,7 +724,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non with pytest.raises(APIStatusError): self.client.post( "/datasources", - body=cast(object, dict(engine="mysql")), + body=cast(object, maybe_transform(dict(engine="mysql"), DatasourceCreateParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -1477,7 +1479,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) with pytest.raises(APITimeoutError): await self.client.post( "/datasources", - body=cast(object, dict(engine="mysql")), + body=cast(object, maybe_transform(dict(engine="mysql"), DatasourceCreateParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -1492,7 +1494,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) with pytest.raises(APIStatusError): await self.client.post( "/datasources", - body=cast(object, dict(engine="mysql")), + body=cast(object, maybe_transform(dict(engine="mysql"), DatasourceCreateParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, )