mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-09 12:54:47 +08:00
Fix p3 ci fails (#14069)
### What problem does this PR solve? fix issue with stale tests on p3 level ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -252,7 +252,7 @@ class TestChatAssistantsList:
|
||||
"chat_assistant_id, keywords, expected_code, expected_num, expected_message",
|
||||
[
|
||||
(lambda r: r[0], "test_chat_assistant_0", 0, 1, ""),
|
||||
(lambda r: r[0], "test_chat_assistant_1", 0, 0, ""),
|
||||
(lambda r: r[0], "test_chat_assistant_1", 0, 1, ""),
|
||||
(lambda r: r[0], "unknown", 0, 0, ""),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -41,7 +41,6 @@ class TestSessionWithChatAssistantDelete:
|
||||
@pytest.mark.parametrize(
|
||||
"chat_assistant_id, expected_code, expected_message",
|
||||
[
|
||||
("", 100, "<MethodNotAllowed '405: Method Not Allowed'>"),
|
||||
(
|
||||
"invalid_chat_assistant_id",
|
||||
109,
|
||||
|
||||
@@ -56,7 +56,7 @@ class TestChatAssistantCreate:
|
||||
([], ""),
|
||||
(lambda r: [r], ""),
|
||||
(["invalid_dataset_id"], "You don't own the dataset invalid_dataset_id"),
|
||||
("invalid_dataset_id", "You don't own the dataset i"),
|
||||
("invalid_dataset_id", "violates type hint list[str] | None"),
|
||||
],
|
||||
)
|
||||
def test_dataset_ids(self, client, add_chunks, dataset_ids, expected_message):
|
||||
|
||||
@@ -25,8 +25,8 @@ class TestChatAssistantsDelete:
|
||||
[
|
||||
pytest.param(None, "", 5, marks=pytest.mark.p3),
|
||||
pytest.param({"ids": []}, "", 5, marks=pytest.mark.p3),
|
||||
pytest.param({"ids": ["invalid_id"]}, "Assistant(invalid_id) not found.", 5, marks=pytest.mark.p3),
|
||||
pytest.param({"ids": ["\n!?。;!?\"'"]}, """Assistant(\n!?。;!?"\') not found.""", 5, marks=pytest.mark.p3),
|
||||
pytest.param({"ids": ["invalid_id"]}, "Chat(invalid_id) not found.", 5, marks=pytest.mark.p3),
|
||||
pytest.param({"ids": ["\n!?。;!?\"'"]}, """Chat(\n!?。;!?"\') not found.""", 5, marks=pytest.mark.p3),
|
||||
pytest.param(lambda r: {"ids": r[:1]}, "", 4, marks=pytest.mark.p3),
|
||||
pytest.param(lambda r: {"ids": r}, "", 0, marks=pytest.mark.p1),
|
||||
],
|
||||
|
||||
@@ -198,7 +198,7 @@ class TestChatAssistantsList:
|
||||
"chat_assistant_id, keywords, expected_num, expected_message",
|
||||
[
|
||||
(lambda r: r[0], "test_chat_assistant_0", 1, ""),
|
||||
(lambda r: r[0], "test_chat_assistant_1", 0, ""),
|
||||
(lambda r: r[0], "test_chat_assistant_1", 1, ""),
|
||||
(lambda r: r[0], "unknown", 0, ""),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -75,8 +75,8 @@ class TestChatAssistantUpdate:
|
||||
pytest.param({"name": "a" * (CHAT_ASSISTANT_NAME_LIMIT + 1)}, "", marks=pytest.mark.skip(reason="issues/")),
|
||||
pytest.param({"name": 1}, "", marks=pytest.mark.skip(reason="issues/")),
|
||||
pytest.param({"name": ""}, "`name` cannot be empty.", marks=pytest.mark.p3),
|
||||
pytest.param({"name": "test_chat_assistant_1"}, "Duplicated chat name in updating chat.", marks=pytest.mark.p3),
|
||||
pytest.param({"name": "TEST_CHAT_ASSISTANT_1"}, "Duplicated chat name in updating chat.", marks=pytest.mark.p3),
|
||||
pytest.param({"name": "test_chat_assistant_1"}, "Duplicated chat name.", marks=pytest.mark.p3),
|
||||
pytest.param({"name": "TEST_CHAT_ASSISTANT_1"}, "Duplicated chat name.", marks=pytest.mark.p3),
|
||||
],
|
||||
)
|
||||
def test_name(self, client, add_chat_assistants_func, payload, expected_message):
|
||||
|
||||
@@ -95,7 +95,7 @@ class TestSessionWithChatAssistantCreate:
|
||||
client.delete_chats(ids=[chat_assistant.id])
|
||||
with pytest.raises(Exception) as exception_info:
|
||||
chat_assistant.create_session(name="valid_name")
|
||||
assert "You do not own the assistant" in str(exception_info.value)
|
||||
assert "No authorization." in str(exception_info.value)
|
||||
|
||||
|
||||
@pytest.mark.p2
|
||||
|
||||
@@ -226,7 +226,7 @@ class TestSessionsWithChatAssistantList:
|
||||
|
||||
with pytest.raises(Exception) as exception_info:
|
||||
chat_assistant.list_sessions()
|
||||
assert "You don't own the assistant" in str(exception_info.value)
|
||||
assert "No authorization." in str(exception_info.value)
|
||||
|
||||
|
||||
@pytest.mark.p2
|
||||
|
||||
@@ -95,4 +95,4 @@ class TestSessionWithChatAssistantUpdate:
|
||||
|
||||
with pytest.raises(Exception) as exception_info:
|
||||
sessions[0].update({"name": "valid_name"})
|
||||
assert "You do not own the session" in str(exception_info.value)
|
||||
assert "No authorization." in str(exception_info.value)
|
||||
|
||||
Reference in New Issue
Block a user