mirror of
https://github.com/anomalyco/opencode-sdk-python.git
synced 2026-04-28 12:39:54 +00:00
feat(api): update via SDK Studio
This commit is contained in:
parent
6d8571b73d
commit
d70071b1fc
6 changed files with 84 additions and 35 deletions
|
|
@ -8,8 +8,6 @@ from typing import Any, cast
|
|||
import pytest
|
||||
|
||||
from opencode_ai import Opencode, AsyncOpencode
|
||||
from tests.utils import assert_matches_type
|
||||
from opencode_ai.types import EventListResponse
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
|
@ -20,18 +18,17 @@ class TestEvent:
|
|||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_list(self, client: Opencode) -> None:
|
||||
event = client.event.list()
|
||||
assert_matches_type(EventListResponse, event, path=["response"])
|
||||
event_stream = client.event.list()
|
||||
event_stream.response.close()
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_list(self, client: Opencode) -> None:
|
||||
response = client.event.with_raw_response.list()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
event = response.parse()
|
||||
assert_matches_type(EventListResponse, event, path=["response"])
|
||||
stream = response.parse()
|
||||
stream.close()
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
|
|
@ -40,8 +37,8 @@ class TestEvent:
|
|||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
event = response.parse()
|
||||
assert_matches_type(EventListResponse, event, path=["response"])
|
||||
stream = response.parse()
|
||||
stream.close()
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -54,18 +51,17 @@ class TestAsyncEvent:
|
|||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_list(self, async_client: AsyncOpencode) -> None:
|
||||
event = await async_client.event.list()
|
||||
assert_matches_type(EventListResponse, event, path=["response"])
|
||||
event_stream = await async_client.event.list()
|
||||
await event_stream.response.aclose()
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_list(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.event.with_raw_response.list()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
event = await response.parse()
|
||||
assert_matches_type(EventListResponse, event, path=["response"])
|
||||
stream = await response.parse()
|
||||
await stream.close()
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
|
|
@ -74,7 +70,7 @@ class TestAsyncEvent:
|
|||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
event = await response.parse()
|
||||
assert_matches_type(EventListResponse, event, path=["response"])
|
||||
stream = await response.parse()
|
||||
await stream.close()
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue