Skip to content

chore(internal): variable name and test updates #79

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
Apr 4, 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
34 changes: 16 additions & 18 deletions tests/api_resources/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,26 @@ def test_streaming_response_list(self, client: Gitpod) -> None:
@pytest.mark.skip(reason="Prism doesn't support JSONL responses yet")
@parametrize
def test_method_watch(self, client: Gitpod) -> None:
event = client.events.watch()
assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"])
event_stream = client.events.watch()
assert_matches_type(JSONLDecoder[EventWatchResponse], event_stream, path=["response"])

@pytest.mark.skip(reason="Prism doesn't support JSONL responses yet")
@parametrize
def test_method_watch_with_all_params(self, client: Gitpod) -> None:
event = client.events.watch(
event_stream = client.events.watch(
environment_id="environmentId",
organization=True,
)
assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"])
assert_matches_type(JSONLDecoder[EventWatchResponse], event_stream, path=["response"])

@pytest.mark.skip(reason="Prism doesn't support JSONL responses yet")
@parametrize
def test_raw_response_watch(self, client: Gitpod) -> None:
response = client.events.with_raw_response.watch()

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
event = response.parse()
assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"])
stream = response.parse()
stream.close()

@pytest.mark.skip(reason="Prism doesn't support JSONL responses yet")
@parametrize
Expand All @@ -98,8 +97,8 @@ def test_streaming_response_watch(self, client: Gitpod) -> None:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

event = response.parse()
assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"])
stream = response.parse()
stream.close()

assert cast(Any, response.is_closed) is True

Expand Down Expand Up @@ -157,27 +156,26 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None:
@pytest.mark.skip(reason="Prism doesn't support JSONL responses yet")
@parametrize
async def test_method_watch(self, async_client: AsyncGitpod) -> None:
event = await async_client.events.watch()
assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"])
event_stream = await async_client.events.watch()
assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event_stream, path=["response"])

@pytest.mark.skip(reason="Prism doesn't support JSONL responses yet")
@parametrize
async def test_method_watch_with_all_params(self, async_client: AsyncGitpod) -> None:
event = await async_client.events.watch(
event_stream = await async_client.events.watch(
environment_id="environmentId",
organization=True,
)
assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"])
assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event_stream, path=["response"])

@pytest.mark.skip(reason="Prism doesn't support JSONL responses yet")
@parametrize
async def test_raw_response_watch(self, async_client: AsyncGitpod) -> None:
response = await async_client.events.with_raw_response.watch()

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
event = await response.parse()
assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"])
stream = await response.parse()
await stream.close()

@pytest.mark.skip(reason="Prism doesn't support JSONL responses yet")
@parametrize
Expand All @@ -186,7 +184,7 @@ async def test_streaming_response_watch(self, async_client: AsyncGitpod) -> None
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

event = await response.parse()
assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"])
stream = await response.parse()
await stream.close()

assert cast(Any, response.is_closed) is True