Skip to content

Commit e4040d1

Browse files
chore(internal): update client tests (#26)
1 parent a13ae46 commit e4040d1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: tests/test_client.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@
2323

2424
from gitpod import Gitpod, AsyncGitpod, APIResponseValidationError
2525
from gitpod._types import Omit
26+
from gitpod._utils import maybe_transform
2627
from gitpod._models import BaseModel, FinalRequestOptions
2728
from gitpod._constants import RAW_RESPONSE_HEADER
2829
from gitpod._exceptions import GitpodError, APIStatusError, APITimeoutError, APIResponseValidationError
2930
from gitpod._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, make_request_options
31+
from gitpod.types.identity_get_authenticated_identity_params import IdentityGetAuthenticatedIdentityParams
3032

3133
from .utils import update_env
3234

@@ -742,7 +744,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
742744
with pytest.raises(APITimeoutError):
743745
self.client.post(
744746
"/gitpod.v1.IdentityService/GetAuthenticatedIdentity",
745-
body=cast(object, dict()),
747+
body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)),
746748
cast_to=httpx.Response,
747749
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
748750
)
@@ -757,7 +759,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
757759
with pytest.raises(APIStatusError):
758760
self.client.post(
759761
"/gitpod.v1.IdentityService/GetAuthenticatedIdentity",
760-
body=cast(object, dict()),
762+
body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)),
761763
cast_to=httpx.Response,
762764
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
763765
)
@@ -1542,7 +1544,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
15421544
with pytest.raises(APITimeoutError):
15431545
await self.client.post(
15441546
"/gitpod.v1.IdentityService/GetAuthenticatedIdentity",
1545-
body=cast(object, dict()),
1547+
body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)),
15461548
cast_to=httpx.Response,
15471549
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
15481550
)
@@ -1557,7 +1559,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
15571559
with pytest.raises(APIStatusError):
15581560
await self.client.post(
15591561
"/gitpod.v1.IdentityService/GetAuthenticatedIdentity",
1560-
body=cast(object, dict()),
1562+
body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)),
15611563
cast_to=httpx.Response,
15621564
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
15631565
)

0 commit comments

Comments
 (0)