Bläddra i källkod

Test: Update test cases for PR 6906 (#6929)

### What problem does this PR solve?

PR #6906

### Type of change

- [x] Update test cases
tags/v0.18.0
liu an 6 månader sedan
förälder
incheckning
8fb5edd927
Inget konto är kopplat till bidragsgivarens mejladress

+ 6
- 6
sdk/python/test/test_http_api/test_chat_assistant_management/test_delete_chat_assistants.py Visa fil

@@ -44,8 +44,8 @@ class TestChatAssistantsDelete:
[
(None, 0, "", 0),
({"ids": []}, 0, "", 0),
({"ids": ["invalid_id"]}, 102, "You don't own the chat invalid_id", 5),
({"ids": ["\n!?。;!?\"'"]}, 102, "You don't own the chat \n!?。;!?\"'", 5),
({"ids": ["invalid_id"]}, 102, "Assistant(invalid_id) not found.", 5),
({"ids": ["\n!?。;!?\"'"]}, 102, """Assistant(\n!?。;!?"\') not found.""", 5),
("not json", 100, "AttributeError(\"'str' object has no attribute 'get'\")", 5),
(lambda r: {"ids": r[:1]}, 0, "", 4),
(lambda r: {"ids": r}, 0, "", 0),
@@ -57,8 +57,8 @@ class TestChatAssistantsDelete:
payload = payload(chat_assistant_ids)
res = delete_chat_assistants(get_http_api_auth, payload)
assert res["code"] == expected_code
#if res["code"] != 0:
# assert res["message"] == expected_message
if res["code"] != 0:
assert res["message"] == expected_message

res = list_chat_assistants(get_http_api_auth)
assert len(res["data"]) == remaining
@@ -90,13 +90,13 @@ class TestChatAssistantsDelete:

res = delete_chat_assistants(get_http_api_auth, {"ids": chat_assistant_ids})
assert res["code"] == 102
#assert "You don't own the chat" in res["message"]
assert "not found" in res["message"]

def test_duplicate_deletion(self, get_http_api_auth, add_chat_assistants_func):
_, _, chat_assistant_ids = add_chat_assistants_func
res = delete_chat_assistants(get_http_api_auth, {"ids": chat_assistant_ids + chat_assistant_ids})
assert res["code"] == 0
assert "Duplicate chat ids" in res["data"]["errors"][0]
assert "Duplicate assistant ids" in res["data"]["errors"][0]
assert res["data"]["success_count"] == 5

res = list_chat_assistants(get_http_api_auth)

Laddar…
Avbryt
Spara