Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@

from gitpod import Gitpod, AsyncGitpod, APIResponseValidationError
from gitpod._types import Omit
from gitpod._utils import maybe_transform
from gitpod._models import BaseModel, FinalRequestOptions
from gitpod._constants import RAW_RESPONSE_HEADER
from gitpod._exceptions import GitpodError, APIStatusError, APITimeoutError, APIResponseValidationError
from gitpod._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, make_request_options
from gitpod.types.identity_get_authenticated_identity_params import IdentityGetAuthenticatedIdentityParams

from .utils import update_env

Expand Down Expand Up @@ -742,7 +744,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
with pytest.raises(APITimeoutError):
self.client.post(
"/gitpod.v1.IdentityService/GetAuthenticatedIdentity",
body=cast(object, dict()),
body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
Expand All @@ -757,7 +759,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
with pytest.raises(APIStatusError):
self.client.post(
"/gitpod.v1.IdentityService/GetAuthenticatedIdentity",
body=cast(object, dict()),
body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
Expand Down Expand Up @@ -1542,7 +1544,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
with pytest.raises(APITimeoutError):
await self.client.post(
"/gitpod.v1.IdentityService/GetAuthenticatedIdentity",
body=cast(object, dict()),
body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
Expand All @@ -1557,7 +1559,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
with pytest.raises(APIStatusError):
await self.client.post(
"/gitpod.v1.IdentityService/GetAuthenticatedIdentity",
body=cast(object, dict()),
body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
Expand Down