Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions tests/api_resources/sys/projects/test_api_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ class TestAPIKeys:
def test_method_create(self, client: Asktable) -> None:
api_key = client.sys.projects.api_keys.create(
project_id="project_id",
ak_role="sys",
ak_role="admin",
)
assert_matches_type(APIKeyCreateResponse, api_key, path=["response"])

@parametrize
def test_raw_response_create(self, client: Asktable) -> None:
response = client.sys.projects.api_keys.with_raw_response.create(
project_id="project_id",
ak_role="sys",
ak_role="admin",
)

assert response.is_closed is True
Expand All @@ -44,7 +44,7 @@ def test_raw_response_create(self, client: Asktable) -> None:
def test_streaming_response_create(self, client: Asktable) -> None:
with client.sys.projects.api_keys.with_streaming_response.create(
project_id="project_id",
ak_role="sys",
ak_role="admin",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -59,7 +59,7 @@ def test_path_params_create(self, client: Asktable) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_id` but received ''"):
client.sys.projects.api_keys.with_raw_response.create(
project_id="",
ak_role="sys",
ak_role="admin",
)

@parametrize
Expand Down Expand Up @@ -159,7 +159,7 @@ def test_method_create_token(self, client: Asktable) -> None:
def test_method_create_token_with_all_params(self, client: Asktable) -> None:
api_key = client.sys.projects.api_keys.create_token(
project_id="project_id",
ak_role="sys",
ak_role="asker",
chat_role={
"role_id": "1",
"role_variables": {"id": "42"},
Expand Down Expand Up @@ -208,15 +208,15 @@ class TestAsyncAPIKeys:
async def test_method_create(self, async_client: AsyncAsktable) -> None:
api_key = await async_client.sys.projects.api_keys.create(
project_id="project_id",
ak_role="sys",
ak_role="admin",
)
assert_matches_type(APIKeyCreateResponse, api_key, path=["response"])

@parametrize
async def test_raw_response_create(self, async_client: AsyncAsktable) -> None:
response = await async_client.sys.projects.api_keys.with_raw_response.create(
project_id="project_id",
ak_role="sys",
ak_role="admin",
)

assert response.is_closed is True
Expand All @@ -228,7 +228,7 @@ async def test_raw_response_create(self, async_client: AsyncAsktable) -> None:
async def test_streaming_response_create(self, async_client: AsyncAsktable) -> None:
async with async_client.sys.projects.api_keys.with_streaming_response.create(
project_id="project_id",
ak_role="sys",
ak_role="admin",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -243,7 +243,7 @@ async def test_path_params_create(self, async_client: AsyncAsktable) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_id` but received ''"):
await async_client.sys.projects.api_keys.with_raw_response.create(
project_id="",
ak_role="sys",
ak_role="admin",
)

@parametrize
Expand Down Expand Up @@ -343,7 +343,7 @@ async def test_method_create_token(self, async_client: AsyncAsktable) -> None:
async def test_method_create_token_with_all_params(self, async_client: AsyncAsktable) -> None:
api_key = await async_client.sys.projects.api_keys.create_token(
project_id="project_id",
ak_role="sys",
ak_role="asker",
chat_role={
"role_id": "1",
"role_variables": {"id": "42"},
Expand Down
4 changes: 2 additions & 2 deletions tests/api_resources/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_method_create_token(self, client: Asktable) -> None:
@parametrize
def test_method_create_token_with_all_params(self, client: Asktable) -> None:
auth = client.auth.create_token(
ak_role="sys",
ak_role="asker",
chat_role={
"role_id": "1",
"role_variables": {"id": "42"},
Expand Down Expand Up @@ -92,7 +92,7 @@ async def test_method_create_token(self, async_client: AsyncAsktable) -> None:
@parametrize
async def test_method_create_token_with_all_params(self, async_client: AsyncAsktable) -> None:
auth = await async_client.auth.create_token(
ak_role="sys",
ak_role="asker",
chat_role={
"role_id": "1",
"role_variables": {"id": "42"},
Expand Down
4 changes: 2 additions & 2 deletions tests/api_resources/test_datasources.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def test_method_update_with_all_params(self, client: Asktable) -> None:
engine="mysql",
field_count=1,
meta_error="error message",
meta_status="processing",
meta_status="success",
name="用户库",
sample_questions="示例问题",
schema_count=1,
Expand Down Expand Up @@ -551,7 +551,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncAsktable)
engine="mysql",
field_count=1,
meta_error="error message",
meta_status="processing",
meta_status="success",
name="用户库",
sample_questions="示例问题",
schema_count=1,
Expand Down