feat(api): manual updates

This commit is contained in:
stainless-app[bot] 2025-09-03 17:15:28 +00:00
parent 9b3134a27e
commit 979c43dbc7
225 changed files with 25869 additions and 1 deletions

View file

@ -0,0 +1 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

View file

@ -0,0 +1 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

View file

@ -0,0 +1,160 @@
# 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_ai import Opencode, AsyncOpencode
from tests.utils import assert_matches_type
from opencode_ai.types.session import PermissionRespondResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
class TestPermissions:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_respond(self, client: Opencode) -> None:
permission = client.session.permissions.respond(
permission_id="permissionID",
id="id",
response="once",
)
assert_matches_type(PermissionRespondResponse, permission, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_respond_with_all_params(self, client: Opencode) -> None:
permission = client.session.permissions.respond(
permission_id="permissionID",
id="id",
response="once",
directory="directory",
)
assert_matches_type(PermissionRespondResponse, permission, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_respond(self, client: Opencode) -> None:
response = client.session.permissions.with_raw_response.respond(
permission_id="permissionID",
id="id",
response="once",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
permission = response.parse()
assert_matches_type(PermissionRespondResponse, permission, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_respond(self, client: Opencode) -> None:
with client.session.permissions.with_streaming_response.respond(
permission_id="permissionID",
id="id",
response="once",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
permission = response.parse()
assert_matches_type(PermissionRespondResponse, permission, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_path_params_respond(self, client: Opencode) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
client.session.permissions.with_raw_response.respond(
permission_id="permissionID",
id="",
response="once",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `permission_id` but received ''"):
client.session.permissions.with_raw_response.respond(
permission_id="",
id="id",
response="once",
)
class TestAsyncPermissions:
parametrize = pytest.mark.parametrize(
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_respond(self, async_client: AsyncOpencode) -> None:
permission = await async_client.session.permissions.respond(
permission_id="permissionID",
id="id",
response="once",
)
assert_matches_type(PermissionRespondResponse, permission, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_respond_with_all_params(self, async_client: AsyncOpencode) -> None:
permission = await async_client.session.permissions.respond(
permission_id="permissionID",
id="id",
response="once",
directory="directory",
)
assert_matches_type(PermissionRespondResponse, permission, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_respond(self, async_client: AsyncOpencode) -> None:
response = await async_client.session.permissions.with_raw_response.respond(
permission_id="permissionID",
id="id",
response="once",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
permission = await response.parse()
assert_matches_type(PermissionRespondResponse, permission, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_respond(self, async_client: AsyncOpencode) -> None:
async with async_client.session.permissions.with_streaming_response.respond(
permission_id="permissionID",
id="id",
response="once",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
permission = await response.parse()
assert_matches_type(PermissionRespondResponse, permission, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_path_params_respond(self, async_client: AsyncOpencode) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
await async_client.session.permissions.with_raw_response.respond(
permission_id="permissionID",
id="",
response="once",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `permission_id` but received ''"):
await async_client.session.permissions.with_raw_response.respond(
permission_id="",
id="id",
response="once",
)

View file

@ -0,0 +1,96 @@
# 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_ai import Opencode, AsyncOpencode
from tests.utils import assert_matches_type
from opencode_ai.types import AgentListResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
class TestAgent:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_list(self, client: Opencode) -> None:
agent = client.agent.list()
assert_matches_type(AgentListResponse, agent, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_list_with_all_params(self, client: Opencode) -> None:
agent = client.agent.list(
directory="directory",
)
assert_matches_type(AgentListResponse, agent, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_list(self, client: Opencode) -> None:
response = client.agent.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
agent = response.parse()
assert_matches_type(AgentListResponse, agent, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_list(self, client: Opencode) -> None:
with client.agent.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
agent = response.parse()
assert_matches_type(AgentListResponse, agent, path=["response"])
assert cast(Any, response.is_closed) is True
class TestAsyncAgent:
parametrize = pytest.mark.parametrize(
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_list(self, async_client: AsyncOpencode) -> None:
agent = await async_client.agent.list()
assert_matches_type(AgentListResponse, agent, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncOpencode) -> None:
agent = await async_client.agent.list(
directory="directory",
)
assert_matches_type(AgentListResponse, agent, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_list(self, async_client: AsyncOpencode) -> None:
response = await async_client.agent.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
agent = await response.parse()
assert_matches_type(AgentListResponse, agent, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_list(self, async_client: AsyncOpencode) -> None:
async with async_client.agent.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
agent = await response.parse()
assert_matches_type(AgentListResponse, agent, path=["response"])
assert cast(Any, response.is_closed) is True

View file

@ -0,0 +1,200 @@
# 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_ai import Opencode, AsyncOpencode
from tests.utils import assert_matches_type
from opencode_ai.types import AppLogResponse, AppProvidersResponse
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(reason="Prism tests are disabled")
@parametrize
def test_method_log(self, client: Opencode) -> None:
app = client.app.log(
level="debug",
message="message",
service="service",
)
assert_matches_type(AppLogResponse, app, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_log_with_all_params(self, client: Opencode) -> None:
app = client.app.log(
level="debug",
message="message",
service="service",
directory="directory",
extra={"foo": "bar"},
)
assert_matches_type(AppLogResponse, app, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_log(self, client: Opencode) -> None:
response = client.app.with_raw_response.log(
level="debug",
message="message",
service="service",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
app = response.parse()
assert_matches_type(AppLogResponse, app, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_log(self, client: Opencode) -> None:
with client.app.with_streaming_response.log(
level="debug",
message="message",
service="service",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
app = response.parse()
assert_matches_type(AppLogResponse, app, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_providers(self, client: Opencode) -> None:
app = client.app.providers()
assert_matches_type(AppProvidersResponse, app, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_providers_with_all_params(self, client: Opencode) -> None:
app = client.app.providers(
directory="directory",
)
assert_matches_type(AppProvidersResponse, app, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_providers(self, client: Opencode) -> None:
response = client.app.with_raw_response.providers()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
app = response.parse()
assert_matches_type(AppProvidersResponse, app, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_providers(self, client: Opencode) -> None:
with client.app.with_streaming_response.providers() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
app = response.parse()
assert_matches_type(AppProvidersResponse, 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(reason="Prism tests are disabled")
@parametrize
async def test_method_log(self, async_client: AsyncOpencode) -> None:
app = await async_client.app.log(
level="debug",
message="message",
service="service",
)
assert_matches_type(AppLogResponse, app, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_log_with_all_params(self, async_client: AsyncOpencode) -> None:
app = await async_client.app.log(
level="debug",
message="message",
service="service",
directory="directory",
extra={"foo": "bar"},
)
assert_matches_type(AppLogResponse, app, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_log(self, async_client: AsyncOpencode) -> None:
response = await async_client.app.with_raw_response.log(
level="debug",
message="message",
service="service",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
app = await response.parse()
assert_matches_type(AppLogResponse, app, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_log(self, async_client: AsyncOpencode) -> None:
async with async_client.app.with_streaming_response.log(
level="debug",
message="message",
service="service",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
app = await response.parse()
assert_matches_type(AppLogResponse, app, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_providers(self, async_client: AsyncOpencode) -> None:
app = await async_client.app.providers()
assert_matches_type(AppProvidersResponse, app, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_providers_with_all_params(self, async_client: AsyncOpencode) -> None:
app = await async_client.app.providers(
directory="directory",
)
assert_matches_type(AppProvidersResponse, app, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_providers(self, async_client: AsyncOpencode) -> None:
response = await async_client.app.with_raw_response.providers()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
app = await response.parse()
assert_matches_type(AppProvidersResponse, app, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_providers(self, async_client: AsyncOpencode) -> None:
async with async_client.app.with_streaming_response.providers() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
app = await response.parse()
assert_matches_type(AppProvidersResponse, app, path=["response"])
assert cast(Any, response.is_closed) is True

View file

@ -0,0 +1,96 @@
# 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_ai import Opencode, AsyncOpencode
from tests.utils import assert_matches_type
from opencode_ai.types import CommandListResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
class TestCommand:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_list(self, client: Opencode) -> None:
command = client.command.list()
assert_matches_type(CommandListResponse, command, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_list_with_all_params(self, client: Opencode) -> None:
command = client.command.list(
directory="directory",
)
assert_matches_type(CommandListResponse, command, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_list(self, client: Opencode) -> None:
response = client.command.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
command = response.parse()
assert_matches_type(CommandListResponse, command, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_list(self, client: Opencode) -> None:
with client.command.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
command = response.parse()
assert_matches_type(CommandListResponse, command, path=["response"])
assert cast(Any, response.is_closed) is True
class TestAsyncCommand:
parametrize = pytest.mark.parametrize(
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_list(self, async_client: AsyncOpencode) -> None:
command = await async_client.command.list()
assert_matches_type(CommandListResponse, command, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncOpencode) -> None:
command = await async_client.command.list(
directory="directory",
)
assert_matches_type(CommandListResponse, command, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_list(self, async_client: AsyncOpencode) -> None:
response = await async_client.command.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
command = await response.parse()
assert_matches_type(CommandListResponse, command, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_list(self, async_client: AsyncOpencode) -> None:
async with async_client.command.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
command = await response.parse()
assert_matches_type(CommandListResponse, command, path=["response"])
assert cast(Any, response.is_closed) is True

View file

@ -0,0 +1,96 @@
# 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_ai import Opencode, AsyncOpencode
from tests.utils import assert_matches_type
from opencode_ai.types import Config
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(reason="Prism tests are disabled")
@parametrize
def test_method_get(self, client: Opencode) -> None:
config = client.config.get()
assert_matches_type(Config, config, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_get_with_all_params(self, client: Opencode) -> None:
config = client.config.get(
directory="directory",
)
assert_matches_type(Config, config, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@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(reason="Prism tests are disabled")
@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
class TestAsyncConfig:
parametrize = pytest.mark.parametrize(
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)
@pytest.mark.skip(reason="Prism tests are disabled")
@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(reason="Prism tests are disabled")
@parametrize
async def test_method_get_with_all_params(self, async_client: AsyncOpencode) -> None:
config = await async_client.config.get(
directory="directory",
)
assert_matches_type(Config, config, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@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(reason="Prism tests are disabled")
@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

View 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_ai import Opencode, AsyncOpencode
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(reason="Prism doesn't support text/event-stream responses")
@parametrize
def test_method_list(self, client: Opencode) -> None:
event_stream = client.event.list()
event_stream.response.close()
@pytest.mark.skip(reason="Prism doesn't support text/event-stream responses")
@parametrize
def test_method_list_with_all_params(self, client: Opencode) -> None:
event_stream = client.event.list(
directory="directory",
)
event_stream.response.close()
@pytest.mark.skip(reason="Prism doesn't support text/event-stream responses")
@parametrize
def test_raw_response_list(self, client: Opencode) -> None:
response = client.event.with_raw_response.list()
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
stream = response.parse()
stream.close()
@pytest.mark.skip(reason="Prism doesn't support text/event-stream responses")
@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"
stream = response.parse()
stream.close()
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(reason="Prism doesn't support text/event-stream responses")
@parametrize
async def test_method_list(self, async_client: AsyncOpencode) -> None:
event_stream = await async_client.event.list()
await event_stream.response.aclose()
@pytest.mark.skip(reason="Prism doesn't support text/event-stream responses")
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncOpencode) -> None:
event_stream = await async_client.event.list(
directory="directory",
)
await event_stream.response.aclose()
@pytest.mark.skip(reason="Prism doesn't support text/event-stream responses")
@parametrize
async def test_raw_response_list(self, async_client: AsyncOpencode) -> None:
response = await async_client.event.with_raw_response.list()
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
stream = await response.parse()
await stream.close()
@pytest.mark.skip(reason="Prism doesn't support text/event-stream responses")
@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"
stream = await response.parse()
await stream.close()
assert cast(Any, response.is_closed) is True

View file

@ -0,0 +1,272 @@
# 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_ai import Opencode, AsyncOpencode
from tests.utils import assert_matches_type
from opencode_ai.types import (
FileListResponse,
FileReadResponse,
FileStatusResponse,
)
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(reason="Prism tests are disabled")
@parametrize
def test_method_list(self, client: Opencode) -> None:
file = client.file.list(
path="path",
)
assert_matches_type(FileListResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_list_with_all_params(self, client: Opencode) -> None:
file = client.file.list(
path="path",
directory="directory",
)
assert_matches_type(FileListResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_list(self, client: Opencode) -> None:
response = client.file.with_raw_response.list(
path="path",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
assert_matches_type(FileListResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_list(self, client: Opencode) -> None:
with client.file.with_streaming_response.list(
path="path",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_read(self, client: Opencode) -> None:
file = client.file.read(
path="path",
)
assert_matches_type(FileReadResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_read_with_all_params(self, client: Opencode) -> None:
file = client.file.read(
path="path",
directory="directory",
)
assert_matches_type(FileReadResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_read(self, client: Opencode) -> None:
response = client.file.with_raw_response.read(
path="path",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
assert_matches_type(FileReadResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_read(self, client: Opencode) -> None:
with client.file.with_streaming_response.read(
path="path",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
assert_matches_type(FileReadResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_status(self, client: Opencode) -> None:
file = client.file.status()
assert_matches_type(FileStatusResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_status_with_all_params(self, client: Opencode) -> None:
file = client.file.status(
directory="directory",
)
assert_matches_type(FileStatusResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_status(self, client: Opencode) -> None:
response = client.file.with_raw_response.status()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
assert_matches_type(FileStatusResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_status(self, client: Opencode) -> None:
with client.file.with_streaming_response.status() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
assert_matches_type(FileStatusResponse, 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(reason="Prism tests are disabled")
@parametrize
async def test_method_list(self, async_client: AsyncOpencode) -> None:
file = await async_client.file.list(
path="path",
)
assert_matches_type(FileListResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncOpencode) -> None:
file = await async_client.file.list(
path="path",
directory="directory",
)
assert_matches_type(FileListResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_list(self, async_client: AsyncOpencode) -> None:
response = await async_client.file.with_raw_response.list(
path="path",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
assert_matches_type(FileListResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_list(self, async_client: AsyncOpencode) -> None:
async with async_client.file.with_streaming_response.list(
path="path",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_read(self, async_client: AsyncOpencode) -> None:
file = await async_client.file.read(
path="path",
)
assert_matches_type(FileReadResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_read_with_all_params(self, async_client: AsyncOpencode) -> None:
file = await async_client.file.read(
path="path",
directory="directory",
)
assert_matches_type(FileReadResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_read(self, async_client: AsyncOpencode) -> None:
response = await async_client.file.with_raw_response.read(
path="path",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
assert_matches_type(FileReadResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_read(self, async_client: AsyncOpencode) -> None:
async with async_client.file.with_streaming_response.read(
path="path",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
assert_matches_type(FileReadResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_status(self, async_client: AsyncOpencode) -> None:
file = await async_client.file.status()
assert_matches_type(FileStatusResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_status_with_all_params(self, async_client: AsyncOpencode) -> None:
file = await async_client.file.status(
directory="directory",
)
assert_matches_type(FileStatusResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_status(self, async_client: AsyncOpencode) -> None:
response = await async_client.file.with_raw_response.status()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
assert_matches_type(FileStatusResponse, file, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_status(self, async_client: AsyncOpencode) -> None:
async with async_client.file.with_streaming_response.status() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
assert_matches_type(FileStatusResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True

View file

@ -0,0 +1,286 @@
# 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_ai import Opencode, AsyncOpencode
from tests.utils import assert_matches_type
from opencode_ai.types import (
FindTextResponse,
FindFilesResponse,
FindSymbolsResponse,
)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
class TestFind:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_files(self, client: Opencode) -> None:
find = client.find.files(
query="query",
)
assert_matches_type(FindFilesResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_files_with_all_params(self, client: Opencode) -> None:
find = client.find.files(
query="query",
directory="directory",
)
assert_matches_type(FindFilesResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_files(self, client: Opencode) -> None:
response = client.find.with_raw_response.files(
query="query",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
find = response.parse()
assert_matches_type(FindFilesResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_files(self, client: Opencode) -> None:
with client.find.with_streaming_response.files(
query="query",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
find = response.parse()
assert_matches_type(FindFilesResponse, find, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_symbols(self, client: Opencode) -> None:
find = client.find.symbols(
query="query",
)
assert_matches_type(FindSymbolsResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_symbols_with_all_params(self, client: Opencode) -> None:
find = client.find.symbols(
query="query",
directory="directory",
)
assert_matches_type(FindSymbolsResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_symbols(self, client: Opencode) -> None:
response = client.find.with_raw_response.symbols(
query="query",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
find = response.parse()
assert_matches_type(FindSymbolsResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_symbols(self, client: Opencode) -> None:
with client.find.with_streaming_response.symbols(
query="query",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
find = response.parse()
assert_matches_type(FindSymbolsResponse, find, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_text(self, client: Opencode) -> None:
find = client.find.text(
pattern="pattern",
)
assert_matches_type(FindTextResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_text_with_all_params(self, client: Opencode) -> None:
find = client.find.text(
pattern="pattern",
directory="directory",
)
assert_matches_type(FindTextResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_text(self, client: Opencode) -> None:
response = client.find.with_raw_response.text(
pattern="pattern",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
find = response.parse()
assert_matches_type(FindTextResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_text(self, client: Opencode) -> None:
with client.find.with_streaming_response.text(
pattern="pattern",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
find = response.parse()
assert_matches_type(FindTextResponse, find, path=["response"])
assert cast(Any, response.is_closed) is True
class TestAsyncFind:
parametrize = pytest.mark.parametrize(
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_files(self, async_client: AsyncOpencode) -> None:
find = await async_client.find.files(
query="query",
)
assert_matches_type(FindFilesResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_files_with_all_params(self, async_client: AsyncOpencode) -> None:
find = await async_client.find.files(
query="query",
directory="directory",
)
assert_matches_type(FindFilesResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_files(self, async_client: AsyncOpencode) -> None:
response = await async_client.find.with_raw_response.files(
query="query",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
find = await response.parse()
assert_matches_type(FindFilesResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_files(self, async_client: AsyncOpencode) -> None:
async with async_client.find.with_streaming_response.files(
query="query",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
find = await response.parse()
assert_matches_type(FindFilesResponse, find, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_symbols(self, async_client: AsyncOpencode) -> None:
find = await async_client.find.symbols(
query="query",
)
assert_matches_type(FindSymbolsResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_symbols_with_all_params(self, async_client: AsyncOpencode) -> None:
find = await async_client.find.symbols(
query="query",
directory="directory",
)
assert_matches_type(FindSymbolsResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_symbols(self, async_client: AsyncOpencode) -> None:
response = await async_client.find.with_raw_response.symbols(
query="query",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
find = await response.parse()
assert_matches_type(FindSymbolsResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_symbols(self, async_client: AsyncOpencode) -> None:
async with async_client.find.with_streaming_response.symbols(
query="query",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
find = await response.parse()
assert_matches_type(FindSymbolsResponse, find, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_text(self, async_client: AsyncOpencode) -> None:
find = await async_client.find.text(
pattern="pattern",
)
assert_matches_type(FindTextResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_text_with_all_params(self, async_client: AsyncOpencode) -> None:
find = await async_client.find.text(
pattern="pattern",
directory="directory",
)
assert_matches_type(FindTextResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_text(self, async_client: AsyncOpencode) -> None:
response = await async_client.find.with_raw_response.text(
pattern="pattern",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
find = await response.parse()
assert_matches_type(FindTextResponse, find, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_text(self, async_client: AsyncOpencode) -> None:
async with async_client.find.with_streaming_response.text(
pattern="pattern",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
find = await response.parse()
assert_matches_type(FindTextResponse, find, path=["response"])
assert cast(Any, response.is_closed) is True

View file

@ -0,0 +1,96 @@
# 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_ai import Opencode, AsyncOpencode
from tests.utils import assert_matches_type
from opencode_ai.types import Path
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
class TestPath:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_get(self, client: Opencode) -> None:
path = client.path.get()
assert_matches_type(Path, path, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_get_with_all_params(self, client: Opencode) -> None:
path = client.path.get(
directory="directory",
)
assert_matches_type(Path, path, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_get(self, client: Opencode) -> None:
response = client.path.with_raw_response.get()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
path = response.parse()
assert_matches_type(Path, path, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_get(self, client: Opencode) -> None:
with client.path.with_streaming_response.get() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
path = response.parse()
assert_matches_type(Path, path, path=["response"])
assert cast(Any, response.is_closed) is True
class TestAsyncPath:
parametrize = pytest.mark.parametrize(
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_get(self, async_client: AsyncOpencode) -> None:
path = await async_client.path.get()
assert_matches_type(Path, path, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_get_with_all_params(self, async_client: AsyncOpencode) -> None:
path = await async_client.path.get(
directory="directory",
)
assert_matches_type(Path, path, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_get(self, async_client: AsyncOpencode) -> None:
response = await async_client.path.with_raw_response.get()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
path = await response.parse()
assert_matches_type(Path, path, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_get(self, async_client: AsyncOpencode) -> None:
async with async_client.path.with_streaming_response.get() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
path = await response.parse()
assert_matches_type(Path, path, path=["response"])
assert cast(Any, response.is_closed) is True

View file

@ -0,0 +1,168 @@
# 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_ai import Opencode, AsyncOpencode
from tests.utils import assert_matches_type
from opencode_ai.types import Project, ProjectListResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
class TestProject:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_list(self, client: Opencode) -> None:
project = client.project.list()
assert_matches_type(ProjectListResponse, project, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_list_with_all_params(self, client: Opencode) -> None:
project = client.project.list(
directory="directory",
)
assert_matches_type(ProjectListResponse, project, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_list(self, client: Opencode) -> None:
response = client.project.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
project = response.parse()
assert_matches_type(ProjectListResponse, project, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_list(self, client: Opencode) -> None:
with client.project.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
project = response.parse()
assert_matches_type(ProjectListResponse, project, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_current(self, client: Opencode) -> None:
project = client.project.current()
assert_matches_type(Project, project, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_current_with_all_params(self, client: Opencode) -> None:
project = client.project.current(
directory="directory",
)
assert_matches_type(Project, project, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_current(self, client: Opencode) -> None:
response = client.project.with_raw_response.current()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
project = response.parse()
assert_matches_type(Project, project, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_current(self, client: Opencode) -> None:
with client.project.with_streaming_response.current() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
project = response.parse()
assert_matches_type(Project, project, path=["response"])
assert cast(Any, response.is_closed) is True
class TestAsyncProject:
parametrize = pytest.mark.parametrize(
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_list(self, async_client: AsyncOpencode) -> None:
project = await async_client.project.list()
assert_matches_type(ProjectListResponse, project, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncOpencode) -> None:
project = await async_client.project.list(
directory="directory",
)
assert_matches_type(ProjectListResponse, project, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_list(self, async_client: AsyncOpencode) -> None:
response = await async_client.project.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
project = await response.parse()
assert_matches_type(ProjectListResponse, project, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_list(self, async_client: AsyncOpencode) -> None:
async with async_client.project.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
project = await response.parse()
assert_matches_type(ProjectListResponse, project, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_current(self, async_client: AsyncOpencode) -> None:
project = await async_client.project.current()
assert_matches_type(Project, project, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_current_with_all_params(self, async_client: AsyncOpencode) -> None:
project = await async_client.project.current(
directory="directory",
)
assert_matches_type(Project, project, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_current(self, async_client: AsyncOpencode) -> None:
response = await async_client.project.with_raw_response.current()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
project = await response.parse()
assert_matches_type(Project, project, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_current(self, async_client: AsyncOpencode) -> None:
async with async_client.project.with_streaming_response.current() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
project = await response.parse()
assert_matches_type(Project, project, path=["response"])
assert cast(Any, response.is_closed) is True

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,734 @@
# 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_ai import Opencode, AsyncOpencode
from tests.utils import assert_matches_type
from opencode_ai.types import (
TuiOpenHelpResponse,
TuiShowToastResponse,
TuiOpenModelsResponse,
TuiOpenThemesResponse,
TuiClearPromptResponse,
TuiAppendPromptResponse,
TuiOpenSessionsResponse,
TuiSubmitPromptResponse,
TuiExecuteCommandResponse,
)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
class TestTui:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_append_prompt(self, client: Opencode) -> None:
tui = client.tui.append_prompt(
text="text",
)
assert_matches_type(TuiAppendPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_append_prompt_with_all_params(self, client: Opencode) -> None:
tui = client.tui.append_prompt(
text="text",
directory="directory",
)
assert_matches_type(TuiAppendPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_append_prompt(self, client: Opencode) -> None:
response = client.tui.with_raw_response.append_prompt(
text="text",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiAppendPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_append_prompt(self, client: Opencode) -> None:
with client.tui.with_streaming_response.append_prompt(
text="text",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiAppendPromptResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_clear_prompt(self, client: Opencode) -> None:
tui = client.tui.clear_prompt()
assert_matches_type(TuiClearPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_clear_prompt_with_all_params(self, client: Opencode) -> None:
tui = client.tui.clear_prompt(
directory="directory",
)
assert_matches_type(TuiClearPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_clear_prompt(self, client: Opencode) -> None:
response = client.tui.with_raw_response.clear_prompt()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiClearPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_clear_prompt(self, client: Opencode) -> None:
with client.tui.with_streaming_response.clear_prompt() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiClearPromptResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_execute_command(self, client: Opencode) -> None:
tui = client.tui.execute_command(
command="command",
)
assert_matches_type(TuiExecuteCommandResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_execute_command_with_all_params(self, client: Opencode) -> None:
tui = client.tui.execute_command(
command="command",
directory="directory",
)
assert_matches_type(TuiExecuteCommandResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_execute_command(self, client: Opencode) -> None:
response = client.tui.with_raw_response.execute_command(
command="command",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiExecuteCommandResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_execute_command(self, client: Opencode) -> None:
with client.tui.with_streaming_response.execute_command(
command="command",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiExecuteCommandResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_open_help(self, client: Opencode) -> None:
tui = client.tui.open_help()
assert_matches_type(TuiOpenHelpResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_open_help_with_all_params(self, client: Opencode) -> None:
tui = client.tui.open_help(
directory="directory",
)
assert_matches_type(TuiOpenHelpResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_open_help(self, client: Opencode) -> None:
response = client.tui.with_raw_response.open_help()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiOpenHelpResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_open_help(self, client: Opencode) -> None:
with client.tui.with_streaming_response.open_help() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiOpenHelpResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_open_models(self, client: Opencode) -> None:
tui = client.tui.open_models()
assert_matches_type(TuiOpenModelsResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_open_models_with_all_params(self, client: Opencode) -> None:
tui = client.tui.open_models(
directory="directory",
)
assert_matches_type(TuiOpenModelsResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_open_models(self, client: Opencode) -> None:
response = client.tui.with_raw_response.open_models()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiOpenModelsResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_open_models(self, client: Opencode) -> None:
with client.tui.with_streaming_response.open_models() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiOpenModelsResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_open_sessions(self, client: Opencode) -> None:
tui = client.tui.open_sessions()
assert_matches_type(TuiOpenSessionsResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_open_sessions_with_all_params(self, client: Opencode) -> None:
tui = client.tui.open_sessions(
directory="directory",
)
assert_matches_type(TuiOpenSessionsResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_open_sessions(self, client: Opencode) -> None:
response = client.tui.with_raw_response.open_sessions()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiOpenSessionsResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_open_sessions(self, client: Opencode) -> None:
with client.tui.with_streaming_response.open_sessions() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiOpenSessionsResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_open_themes(self, client: Opencode) -> None:
tui = client.tui.open_themes()
assert_matches_type(TuiOpenThemesResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_open_themes_with_all_params(self, client: Opencode) -> None:
tui = client.tui.open_themes(
directory="directory",
)
assert_matches_type(TuiOpenThemesResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_open_themes(self, client: Opencode) -> None:
response = client.tui.with_raw_response.open_themes()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiOpenThemesResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_open_themes(self, client: Opencode) -> None:
with client.tui.with_streaming_response.open_themes() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiOpenThemesResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_show_toast(self, client: Opencode) -> None:
tui = client.tui.show_toast(
message="message",
variant="info",
)
assert_matches_type(TuiShowToastResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_show_toast_with_all_params(self, client: Opencode) -> None:
tui = client.tui.show_toast(
message="message",
variant="info",
directory="directory",
title="title",
)
assert_matches_type(TuiShowToastResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_show_toast(self, client: Opencode) -> None:
response = client.tui.with_raw_response.show_toast(
message="message",
variant="info",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiShowToastResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_show_toast(self, client: Opencode) -> None:
with client.tui.with_streaming_response.show_toast(
message="message",
variant="info",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiShowToastResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_submit_prompt(self, client: Opencode) -> None:
tui = client.tui.submit_prompt()
assert_matches_type(TuiSubmitPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_method_submit_prompt_with_all_params(self, client: Opencode) -> None:
tui = client.tui.submit_prompt(
directory="directory",
)
assert_matches_type(TuiSubmitPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_raw_response_submit_prompt(self, client: Opencode) -> None:
response = client.tui.with_raw_response.submit_prompt()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiSubmitPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
def test_streaming_response_submit_prompt(self, client: Opencode) -> None:
with client.tui.with_streaming_response.submit_prompt() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = response.parse()
assert_matches_type(TuiSubmitPromptResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
class TestAsyncTui:
parametrize = pytest.mark.parametrize(
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_append_prompt(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.append_prompt(
text="text",
)
assert_matches_type(TuiAppendPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_append_prompt_with_all_params(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.append_prompt(
text="text",
directory="directory",
)
assert_matches_type(TuiAppendPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_append_prompt(self, async_client: AsyncOpencode) -> None:
response = await async_client.tui.with_raw_response.append_prompt(
text="text",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiAppendPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_append_prompt(self, async_client: AsyncOpencode) -> None:
async with async_client.tui.with_streaming_response.append_prompt(
text="text",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiAppendPromptResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_clear_prompt(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.clear_prompt()
assert_matches_type(TuiClearPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_clear_prompt_with_all_params(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.clear_prompt(
directory="directory",
)
assert_matches_type(TuiClearPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_clear_prompt(self, async_client: AsyncOpencode) -> None:
response = await async_client.tui.with_raw_response.clear_prompt()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiClearPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_clear_prompt(self, async_client: AsyncOpencode) -> None:
async with async_client.tui.with_streaming_response.clear_prompt() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiClearPromptResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_execute_command(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.execute_command(
command="command",
)
assert_matches_type(TuiExecuteCommandResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_execute_command_with_all_params(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.execute_command(
command="command",
directory="directory",
)
assert_matches_type(TuiExecuteCommandResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_execute_command(self, async_client: AsyncOpencode) -> None:
response = await async_client.tui.with_raw_response.execute_command(
command="command",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiExecuteCommandResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_execute_command(self, async_client: AsyncOpencode) -> None:
async with async_client.tui.with_streaming_response.execute_command(
command="command",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiExecuteCommandResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_open_help(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.open_help()
assert_matches_type(TuiOpenHelpResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_open_help_with_all_params(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.open_help(
directory="directory",
)
assert_matches_type(TuiOpenHelpResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_open_help(self, async_client: AsyncOpencode) -> None:
response = await async_client.tui.with_raw_response.open_help()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiOpenHelpResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_open_help(self, async_client: AsyncOpencode) -> None:
async with async_client.tui.with_streaming_response.open_help() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiOpenHelpResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_open_models(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.open_models()
assert_matches_type(TuiOpenModelsResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_open_models_with_all_params(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.open_models(
directory="directory",
)
assert_matches_type(TuiOpenModelsResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_open_models(self, async_client: AsyncOpencode) -> None:
response = await async_client.tui.with_raw_response.open_models()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiOpenModelsResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_open_models(self, async_client: AsyncOpencode) -> None:
async with async_client.tui.with_streaming_response.open_models() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiOpenModelsResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_open_sessions(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.open_sessions()
assert_matches_type(TuiOpenSessionsResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_open_sessions_with_all_params(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.open_sessions(
directory="directory",
)
assert_matches_type(TuiOpenSessionsResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_open_sessions(self, async_client: AsyncOpencode) -> None:
response = await async_client.tui.with_raw_response.open_sessions()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiOpenSessionsResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_open_sessions(self, async_client: AsyncOpencode) -> None:
async with async_client.tui.with_streaming_response.open_sessions() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiOpenSessionsResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_open_themes(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.open_themes()
assert_matches_type(TuiOpenThemesResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_open_themes_with_all_params(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.open_themes(
directory="directory",
)
assert_matches_type(TuiOpenThemesResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_open_themes(self, async_client: AsyncOpencode) -> None:
response = await async_client.tui.with_raw_response.open_themes()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiOpenThemesResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_open_themes(self, async_client: AsyncOpencode) -> None:
async with async_client.tui.with_streaming_response.open_themes() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiOpenThemesResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_show_toast(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.show_toast(
message="message",
variant="info",
)
assert_matches_type(TuiShowToastResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_show_toast_with_all_params(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.show_toast(
message="message",
variant="info",
directory="directory",
title="title",
)
assert_matches_type(TuiShowToastResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_show_toast(self, async_client: AsyncOpencode) -> None:
response = await async_client.tui.with_raw_response.show_toast(
message="message",
variant="info",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiShowToastResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_show_toast(self, async_client: AsyncOpencode) -> None:
async with async_client.tui.with_streaming_response.show_toast(
message="message",
variant="info",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiShowToastResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_submit_prompt(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.submit_prompt()
assert_matches_type(TuiSubmitPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_method_submit_prompt_with_all_params(self, async_client: AsyncOpencode) -> None:
tui = await async_client.tui.submit_prompt(
directory="directory",
)
assert_matches_type(TuiSubmitPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_raw_response_submit_prompt(self, async_client: AsyncOpencode) -> None:
response = await async_client.tui.with_raw_response.submit_prompt()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiSubmitPromptResponse, tui, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
async def test_streaming_response_submit_prompt(self, async_client: AsyncOpencode) -> None:
async with async_client.tui.with_streaming_response.submit_prompt() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tui = await response.parse()
assert_matches_type(TuiSubmitPromptResponse, tui, path=["response"])
assert cast(Any, response.is_closed) is True