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
604017133e
commit
ff05a4adf0
130 changed files with 17166 additions and 1 deletions
1
tests/api_resources/__init__.py
Normal file
1
tests/api_resources/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
136
tests/api_resources/test_app.py
Normal file
136
tests/api_resources/test_app.py
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from opencode import Opencode, AsyncOpencode
|
||||
from tests.utils import assert_matches_type
|
||||
from opencode.types import App, AppInitResponse
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
||||
class TestApp:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_get(self, client: Opencode) -> None:
|
||||
app = client.app.get()
|
||||
assert_matches_type(App, app, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_get(self, client: Opencode) -> None:
|
||||
response = client.app.with_raw_response.get()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
app = response.parse()
|
||||
assert_matches_type(App, app, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_get(self, client: Opencode) -> None:
|
||||
with client.app.with_streaming_response.get() as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
app = response.parse()
|
||||
assert_matches_type(App, app, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_init(self, client: Opencode) -> None:
|
||||
app = client.app.init()
|
||||
assert_matches_type(AppInitResponse, app, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_init(self, client: Opencode) -> None:
|
||||
response = client.app.with_raw_response.init()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
app = response.parse()
|
||||
assert_matches_type(AppInitResponse, app, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_init(self, client: Opencode) -> None:
|
||||
with client.app.with_streaming_response.init() as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
app = response.parse()
|
||||
assert_matches_type(AppInitResponse, app, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
||||
class TestAsyncApp:
|
||||
parametrize = pytest.mark.parametrize(
|
||||
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_get(self, async_client: AsyncOpencode) -> None:
|
||||
app = await async_client.app.get()
|
||||
assert_matches_type(App, app, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_get(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.app.with_raw_response.get()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
app = await response.parse()
|
||||
assert_matches_type(App, app, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_get(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.app.with_streaming_response.get() as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
app = await response.parse()
|
||||
assert_matches_type(App, app, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_init(self, async_client: AsyncOpencode) -> None:
|
||||
app = await async_client.app.init()
|
||||
assert_matches_type(AppInitResponse, app, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_init(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.app.with_raw_response.init()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
app = await response.parse()
|
||||
assert_matches_type(AppInitResponse, app, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_init(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.app.with_streaming_response.init() as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
app = await response.parse()
|
||||
assert_matches_type(AppInitResponse, app, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
136
tests/api_resources/test_config.py
Normal file
136
tests/api_resources/test_config.py
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from opencode import Opencode, AsyncOpencode
|
||||
from tests.utils import assert_matches_type
|
||||
from opencode.types import Config, ConfigProvidersResponse
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
||||
class TestConfig:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_get(self, client: Opencode) -> None:
|
||||
config = client.config.get()
|
||||
assert_matches_type(Config, config, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_get(self, client: Opencode) -> None:
|
||||
response = client.config.with_raw_response.get()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
config = response.parse()
|
||||
assert_matches_type(Config, config, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_get(self, client: Opencode) -> None:
|
||||
with client.config.with_streaming_response.get() as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
config = response.parse()
|
||||
assert_matches_type(Config, config, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_providers(self, client: Opencode) -> None:
|
||||
config = client.config.providers()
|
||||
assert_matches_type(ConfigProvidersResponse, config, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_providers(self, client: Opencode) -> None:
|
||||
response = client.config.with_raw_response.providers()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
config = response.parse()
|
||||
assert_matches_type(ConfigProvidersResponse, config, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_providers(self, client: Opencode) -> None:
|
||||
with client.config.with_streaming_response.providers() as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
config = response.parse()
|
||||
assert_matches_type(ConfigProvidersResponse, config, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
||||
class TestAsyncConfig:
|
||||
parametrize = pytest.mark.parametrize(
|
||||
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_get(self, async_client: AsyncOpencode) -> None:
|
||||
config = await async_client.config.get()
|
||||
assert_matches_type(Config, config, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_get(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.config.with_raw_response.get()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
config = await response.parse()
|
||||
assert_matches_type(Config, config, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_get(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.config.with_streaming_response.get() as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
config = await response.parse()
|
||||
assert_matches_type(Config, config, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_providers(self, async_client: AsyncOpencode) -> None:
|
||||
config = await async_client.config.providers()
|
||||
assert_matches_type(ConfigProvidersResponse, config, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_providers(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.config.with_raw_response.providers()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
config = await response.parse()
|
||||
assert_matches_type(ConfigProvidersResponse, config, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_providers(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.config.with_streaming_response.providers() as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
config = await response.parse()
|
||||
assert_matches_type(ConfigProvidersResponse, config, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
80
tests/api_resources/test_event.py
Normal file
80
tests/api_resources/test_event.py
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from opencode import Opencode, AsyncOpencode
|
||||
from tests.utils import assert_matches_type
|
||||
from opencode.types import EventListResponse
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
||||
class TestEvent:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_list(self, client: Opencode) -> None:
|
||||
event = client.event.list()
|
||||
assert_matches_type(EventListResponse, event, path=["response"])
|
||||
|
||||
@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"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_list(self, client: Opencode) -> None:
|
||||
with client.event.with_streaming_response.list() as response:
|
||||
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"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
||||
class TestAsyncEvent:
|
||||
parametrize = pytest.mark.parametrize(
|
||||
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
|
||||
)
|
||||
|
||||
@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"])
|
||||
|
||||
@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"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_list(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.event.with_streaming_response.list() as response:
|
||||
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"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
92
tests/api_resources/test_file.py
Normal file
92
tests/api_resources/test_file.py
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from opencode import Opencode, AsyncOpencode
|
||||
from tests.utils import assert_matches_type
|
||||
from opencode.types import FileSearchResponse
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
||||
class TestFile:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_search(self, client: Opencode) -> None:
|
||||
file = client.file.search(
|
||||
query="query",
|
||||
)
|
||||
assert_matches_type(FileSearchResponse, file, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_search(self, client: Opencode) -> None:
|
||||
response = client.file.with_raw_response.search(
|
||||
query="query",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
file = response.parse()
|
||||
assert_matches_type(FileSearchResponse, file, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_search(self, client: Opencode) -> None:
|
||||
with client.file.with_streaming_response.search(
|
||||
query="query",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
file = response.parse()
|
||||
assert_matches_type(FileSearchResponse, file, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
||||
class TestAsyncFile:
|
||||
parametrize = pytest.mark.parametrize(
|
||||
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_search(self, async_client: AsyncOpencode) -> None:
|
||||
file = await async_client.file.search(
|
||||
query="query",
|
||||
)
|
||||
assert_matches_type(FileSearchResponse, file, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_search(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.file.with_raw_response.search(
|
||||
query="query",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
file = await response.parse()
|
||||
assert_matches_type(FileSearchResponse, file, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_search(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.file.with_streaming_response.search(
|
||||
query="query",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
file = await response.parse()
|
||||
assert_matches_type(FileSearchResponse, file, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
921
tests/api_resources/test_session.py
Normal file
921
tests/api_resources/test_session.py
Normal file
|
|
@ -0,0 +1,921 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from opencode import Opencode, AsyncOpencode
|
||||
from tests.utils import assert_matches_type
|
||||
from opencode.types import (
|
||||
Message,
|
||||
Session,
|
||||
SessionInitResponse,
|
||||
SessionListResponse,
|
||||
SessionAbortResponse,
|
||||
SessionDeleteResponse,
|
||||
SessionMessagesResponse,
|
||||
SessionSummarizeResponse,
|
||||
)
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
||||
class TestSession:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_create(self, client: Opencode) -> None:
|
||||
session = client.session.create()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_create(self, client: Opencode) -> None:
|
||||
response = client.session.with_raw_response.create()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = response.parse()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_create(self, client: Opencode) -> None:
|
||||
with client.session.with_streaming_response.create() as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = response.parse()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_list(self, client: Opencode) -> None:
|
||||
session = client.session.list()
|
||||
assert_matches_type(SessionListResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_list(self, client: Opencode) -> None:
|
||||
response = client.session.with_raw_response.list()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = response.parse()
|
||||
assert_matches_type(SessionListResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_list(self, client: Opencode) -> None:
|
||||
with client.session.with_streaming_response.list() as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = response.parse()
|
||||
assert_matches_type(SessionListResponse, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_delete(self, client: Opencode) -> None:
|
||||
session = client.session.delete(
|
||||
"id",
|
||||
)
|
||||
assert_matches_type(SessionDeleteResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_delete(self, client: Opencode) -> None:
|
||||
response = client.session.with_raw_response.delete(
|
||||
"id",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = response.parse()
|
||||
assert_matches_type(SessionDeleteResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_delete(self, client: Opencode) -> None:
|
||||
with client.session.with_streaming_response.delete(
|
||||
"id",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = response.parse()
|
||||
assert_matches_type(SessionDeleteResponse, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_delete(self, client: Opencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
client.session.with_raw_response.delete(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_abort(self, client: Opencode) -> None:
|
||||
session = client.session.abort(
|
||||
"id",
|
||||
)
|
||||
assert_matches_type(SessionAbortResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_abort(self, client: Opencode) -> None:
|
||||
response = client.session.with_raw_response.abort(
|
||||
"id",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = response.parse()
|
||||
assert_matches_type(SessionAbortResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_abort(self, client: Opencode) -> None:
|
||||
with client.session.with_streaming_response.abort(
|
||||
"id",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = response.parse()
|
||||
assert_matches_type(SessionAbortResponse, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_abort(self, client: Opencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
client.session.with_raw_response.abort(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_chat(self, client: Opencode) -> None:
|
||||
session = client.session.chat(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
parts=[
|
||||
{
|
||||
"text": "text",
|
||||
"type": "text",
|
||||
}
|
||||
],
|
||||
provider_id="providerID",
|
||||
session_id="sessionID",
|
||||
)
|
||||
assert_matches_type(Message, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_chat(self, client: Opencode) -> None:
|
||||
response = client.session.with_raw_response.chat(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
parts=[
|
||||
{
|
||||
"text": "text",
|
||||
"type": "text",
|
||||
}
|
||||
],
|
||||
provider_id="providerID",
|
||||
session_id="sessionID",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = response.parse()
|
||||
assert_matches_type(Message, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_chat(self, client: Opencode) -> None:
|
||||
with client.session.with_streaming_response.chat(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
parts=[
|
||||
{
|
||||
"text": "text",
|
||||
"type": "text",
|
||||
}
|
||||
],
|
||||
provider_id="providerID",
|
||||
session_id="sessionID",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = response.parse()
|
||||
assert_matches_type(Message, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_chat(self, client: Opencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
client.session.with_raw_response.chat(
|
||||
id="",
|
||||
model_id="modelID",
|
||||
parts=[
|
||||
{
|
||||
"text": "text",
|
||||
"type": "text",
|
||||
}
|
||||
],
|
||||
provider_id="providerID",
|
||||
session_id="sessionID",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_init(self, client: Opencode) -> None:
|
||||
session = client.session.init(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
)
|
||||
assert_matches_type(SessionInitResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_init(self, client: Opencode) -> None:
|
||||
response = client.session.with_raw_response.init(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = response.parse()
|
||||
assert_matches_type(SessionInitResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_init(self, client: Opencode) -> None:
|
||||
with client.session.with_streaming_response.init(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = response.parse()
|
||||
assert_matches_type(SessionInitResponse, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_init(self, client: Opencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
client.session.with_raw_response.init(
|
||||
id="",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_messages(self, client: Opencode) -> None:
|
||||
session = client.session.messages(
|
||||
"id",
|
||||
)
|
||||
assert_matches_type(SessionMessagesResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_messages(self, client: Opencode) -> None:
|
||||
response = client.session.with_raw_response.messages(
|
||||
"id",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = response.parse()
|
||||
assert_matches_type(SessionMessagesResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_messages(self, client: Opencode) -> None:
|
||||
with client.session.with_streaming_response.messages(
|
||||
"id",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = response.parse()
|
||||
assert_matches_type(SessionMessagesResponse, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_messages(self, client: Opencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
client.session.with_raw_response.messages(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_share(self, client: Opencode) -> None:
|
||||
session = client.session.share(
|
||||
"id",
|
||||
)
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_share(self, client: Opencode) -> None:
|
||||
response = client.session.with_raw_response.share(
|
||||
"id",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = response.parse()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_share(self, client: Opencode) -> None:
|
||||
with client.session.with_streaming_response.share(
|
||||
"id",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = response.parse()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_share(self, client: Opencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
client.session.with_raw_response.share(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_summarize(self, client: Opencode) -> None:
|
||||
session = client.session.summarize(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
)
|
||||
assert_matches_type(SessionSummarizeResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_summarize(self, client: Opencode) -> None:
|
||||
response = client.session.with_raw_response.summarize(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = response.parse()
|
||||
assert_matches_type(SessionSummarizeResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_summarize(self, client: Opencode) -> None:
|
||||
with client.session.with_streaming_response.summarize(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = response.parse()
|
||||
assert_matches_type(SessionSummarizeResponse, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_summarize(self, client: Opencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
client.session.with_raw_response.summarize(
|
||||
id="",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_unshare(self, client: Opencode) -> None:
|
||||
session = client.session.unshare(
|
||||
"id",
|
||||
)
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_unshare(self, client: Opencode) -> None:
|
||||
response = client.session.with_raw_response.unshare(
|
||||
"id",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = response.parse()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_unshare(self, client: Opencode) -> None:
|
||||
with client.session.with_streaming_response.unshare(
|
||||
"id",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = response.parse()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_unshare(self, client: Opencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
client.session.with_raw_response.unshare(
|
||||
"",
|
||||
)
|
||||
|
||||
|
||||
class TestAsyncSession:
|
||||
parametrize = pytest.mark.parametrize(
|
||||
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_create(self, async_client: AsyncOpencode) -> None:
|
||||
session = await async_client.session.create()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_create(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.session.with_raw_response.create()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = await response.parse()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_create(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.session.with_streaming_response.create() as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = await response.parse()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_list(self, async_client: AsyncOpencode) -> None:
|
||||
session = await async_client.session.list()
|
||||
assert_matches_type(SessionListResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_list(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.session.with_raw_response.list()
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = await response.parse()
|
||||
assert_matches_type(SessionListResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_list(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.session.with_streaming_response.list() as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = await response.parse()
|
||||
assert_matches_type(SessionListResponse, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_delete(self, async_client: AsyncOpencode) -> None:
|
||||
session = await async_client.session.delete(
|
||||
"id",
|
||||
)
|
||||
assert_matches_type(SessionDeleteResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_delete(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.session.with_raw_response.delete(
|
||||
"id",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = await response.parse()
|
||||
assert_matches_type(SessionDeleteResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_delete(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.session.with_streaming_response.delete(
|
||||
"id",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = await response.parse()
|
||||
assert_matches_type(SessionDeleteResponse, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_delete(self, async_client: AsyncOpencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
await async_client.session.with_raw_response.delete(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_abort(self, async_client: AsyncOpencode) -> None:
|
||||
session = await async_client.session.abort(
|
||||
"id",
|
||||
)
|
||||
assert_matches_type(SessionAbortResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_abort(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.session.with_raw_response.abort(
|
||||
"id",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = await response.parse()
|
||||
assert_matches_type(SessionAbortResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_abort(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.session.with_streaming_response.abort(
|
||||
"id",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = await response.parse()
|
||||
assert_matches_type(SessionAbortResponse, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_abort(self, async_client: AsyncOpencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
await async_client.session.with_raw_response.abort(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_chat(self, async_client: AsyncOpencode) -> None:
|
||||
session = await async_client.session.chat(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
parts=[
|
||||
{
|
||||
"text": "text",
|
||||
"type": "text",
|
||||
}
|
||||
],
|
||||
provider_id="providerID",
|
||||
session_id="sessionID",
|
||||
)
|
||||
assert_matches_type(Message, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_chat(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.session.with_raw_response.chat(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
parts=[
|
||||
{
|
||||
"text": "text",
|
||||
"type": "text",
|
||||
}
|
||||
],
|
||||
provider_id="providerID",
|
||||
session_id="sessionID",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = await response.parse()
|
||||
assert_matches_type(Message, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_chat(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.session.with_streaming_response.chat(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
parts=[
|
||||
{
|
||||
"text": "text",
|
||||
"type": "text",
|
||||
}
|
||||
],
|
||||
provider_id="providerID",
|
||||
session_id="sessionID",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = await response.parse()
|
||||
assert_matches_type(Message, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_chat(self, async_client: AsyncOpencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
await async_client.session.with_raw_response.chat(
|
||||
id="",
|
||||
model_id="modelID",
|
||||
parts=[
|
||||
{
|
||||
"text": "text",
|
||||
"type": "text",
|
||||
}
|
||||
],
|
||||
provider_id="providerID",
|
||||
session_id="sessionID",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_init(self, async_client: AsyncOpencode) -> None:
|
||||
session = await async_client.session.init(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
)
|
||||
assert_matches_type(SessionInitResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_init(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.session.with_raw_response.init(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = await response.parse()
|
||||
assert_matches_type(SessionInitResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_init(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.session.with_streaming_response.init(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = await response.parse()
|
||||
assert_matches_type(SessionInitResponse, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_init(self, async_client: AsyncOpencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
await async_client.session.with_raw_response.init(
|
||||
id="",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_messages(self, async_client: AsyncOpencode) -> None:
|
||||
session = await async_client.session.messages(
|
||||
"id",
|
||||
)
|
||||
assert_matches_type(SessionMessagesResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_messages(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.session.with_raw_response.messages(
|
||||
"id",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = await response.parse()
|
||||
assert_matches_type(SessionMessagesResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_messages(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.session.with_streaming_response.messages(
|
||||
"id",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = await response.parse()
|
||||
assert_matches_type(SessionMessagesResponse, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_messages(self, async_client: AsyncOpencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
await async_client.session.with_raw_response.messages(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_share(self, async_client: AsyncOpencode) -> None:
|
||||
session = await async_client.session.share(
|
||||
"id",
|
||||
)
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_share(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.session.with_raw_response.share(
|
||||
"id",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = await response.parse()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_share(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.session.with_streaming_response.share(
|
||||
"id",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = await response.parse()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_share(self, async_client: AsyncOpencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
await async_client.session.with_raw_response.share(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_summarize(self, async_client: AsyncOpencode) -> None:
|
||||
session = await async_client.session.summarize(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
)
|
||||
assert_matches_type(SessionSummarizeResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_summarize(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.session.with_raw_response.summarize(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = await response.parse()
|
||||
assert_matches_type(SessionSummarizeResponse, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_summarize(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.session.with_streaming_response.summarize(
|
||||
id="id",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = await response.parse()
|
||||
assert_matches_type(SessionSummarizeResponse, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_summarize(self, async_client: AsyncOpencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
await async_client.session.with_raw_response.summarize(
|
||||
id="",
|
||||
model_id="modelID",
|
||||
provider_id="providerID",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_unshare(self, async_client: AsyncOpencode) -> None:
|
||||
session = await async_client.session.unshare(
|
||||
"id",
|
||||
)
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_unshare(self, async_client: AsyncOpencode) -> None:
|
||||
response = await async_client.session.with_raw_response.unshare(
|
||||
"id",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
session = await response.parse()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_unshare(self, async_client: AsyncOpencode) -> None:
|
||||
async with async_client.session.with_streaming_response.unshare(
|
||||
"id",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
session = await response.parse()
|
||||
assert_matches_type(Session, session, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_unshare(self, async_client: AsyncOpencode) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
|
||||
await async_client.session.with_raw_response.unshare(
|
||||
"",
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue