Skip to content

Commit 417b6e9

Browse files
chore(tests): improve enum examples (#198)
1 parent e57fd4f commit 417b6e9

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

tests/api_resources/sys/projects/test_api_keys.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ class TestAPIKeys:
2424
def test_method_create(self, client: Asktable) -> None:
2525
api_key = client.sys.projects.api_keys.create(
2626
project_id="project_id",
27-
ak_role="sys",
27+
ak_role="admin",
2828
)
2929
assert_matches_type(APIKeyCreateResponse, api_key, path=["response"])
3030

3131
@parametrize
3232
def test_raw_response_create(self, client: Asktable) -> None:
3333
response = client.sys.projects.api_keys.with_raw_response.create(
3434
project_id="project_id",
35-
ak_role="sys",
35+
ak_role="admin",
3636
)
3737

3838
assert response.is_closed is True
@@ -44,7 +44,7 @@ def test_raw_response_create(self, client: Asktable) -> None:
4444
def test_streaming_response_create(self, client: Asktable) -> None:
4545
with client.sys.projects.api_keys.with_streaming_response.create(
4646
project_id="project_id",
47-
ak_role="sys",
47+
ak_role="admin",
4848
) as response:
4949
assert not response.is_closed
5050
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -59,7 +59,7 @@ def test_path_params_create(self, client: Asktable) -> None:
5959
with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_id` but received ''"):
6060
client.sys.projects.api_keys.with_raw_response.create(
6161
project_id="",
62-
ak_role="sys",
62+
ak_role="admin",
6363
)
6464

6565
@parametrize
@@ -159,7 +159,7 @@ def test_method_create_token(self, client: Asktable) -> None:
159159
def test_method_create_token_with_all_params(self, client: Asktable) -> None:
160160
api_key = client.sys.projects.api_keys.create_token(
161161
project_id="project_id",
162-
ak_role="sys",
162+
ak_role="asker",
163163
chat_role={
164164
"role_id": "1",
165165
"role_variables": {"id": "42"},
@@ -208,15 +208,15 @@ class TestAsyncAPIKeys:
208208
async def test_method_create(self, async_client: AsyncAsktable) -> None:
209209
api_key = await async_client.sys.projects.api_keys.create(
210210
project_id="project_id",
211-
ak_role="sys",
211+
ak_role="admin",
212212
)
213213
assert_matches_type(APIKeyCreateResponse, api_key, path=["response"])
214214

215215
@parametrize
216216
async def test_raw_response_create(self, async_client: AsyncAsktable) -> None:
217217
response = await async_client.sys.projects.api_keys.with_raw_response.create(
218218
project_id="project_id",
219-
ak_role="sys",
219+
ak_role="admin",
220220
)
221221

222222
assert response.is_closed is True
@@ -228,7 +228,7 @@ async def test_raw_response_create(self, async_client: AsyncAsktable) -> None:
228228
async def test_streaming_response_create(self, async_client: AsyncAsktable) -> None:
229229
async with async_client.sys.projects.api_keys.with_streaming_response.create(
230230
project_id="project_id",
231-
ak_role="sys",
231+
ak_role="admin",
232232
) as response:
233233
assert not response.is_closed
234234
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -243,7 +243,7 @@ async def test_path_params_create(self, async_client: AsyncAsktable) -> None:
243243
with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_id` but received ''"):
244244
await async_client.sys.projects.api_keys.with_raw_response.create(
245245
project_id="",
246-
ak_role="sys",
246+
ak_role="admin",
247247
)
248248

249249
@parametrize
@@ -343,7 +343,7 @@ async def test_method_create_token(self, async_client: AsyncAsktable) -> None:
343343
async def test_method_create_token_with_all_params(self, async_client: AsyncAsktable) -> None:
344344
api_key = await async_client.sys.projects.api_keys.create_token(
345345
project_id="project_id",
346-
ak_role="sys",
346+
ak_role="asker",
347347
chat_role={
348348
"role_id": "1",
349349
"role_variables": {"id": "42"},

tests/api_resources/test_auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_method_create_token(self, client: Asktable) -> None:
2525
@parametrize
2626
def test_method_create_token_with_all_params(self, client: Asktable) -> None:
2727
auth = client.auth.create_token(
28-
ak_role="sys",
28+
ak_role="asker",
2929
chat_role={
3030
"role_id": "1",
3131
"role_variables": {"id": "42"},
@@ -92,7 +92,7 @@ async def test_method_create_token(self, async_client: AsyncAsktable) -> None:
9292
@parametrize
9393
async def test_method_create_token_with_all_params(self, async_client: AsyncAsktable) -> None:
9494
auth = await async_client.auth.create_token(
95-
ak_role="sys",
95+
ak_role="asker",
9696
chat_role={
9797
"role_id": "1",
9898
"role_variables": {"id": "42"},

tests/api_resources/test_datasources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def test_method_update_with_all_params(self, client: Asktable) -> None:
134134
engine="mysql",
135135
field_count=1,
136136
meta_error="error message",
137-
meta_status="processing",
137+
meta_status="success",
138138
name="用户库",
139139
sample_questions="示例问题",
140140
schema_count=1,
@@ -551,7 +551,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncAsktable)
551551
engine="mysql",
552552
field_count=1,
553553
meta_error="error message",
554-
meta_status="processing",
554+
meta_status="success",
555555
name="用户库",
556556
sample_questions="示例问题",
557557
schema_count=1,

0 commit comments

Comments
 (0)