Skip to content

chore(internal): update client tests #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025
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