Skip to content

Commit a854c16

Browse files
taskingaijcSimsonW
authored andcommitted
test: add testcase
1 parent a632d31 commit a854c16

23 files changed

+3070
-1107
lines changed

test/common/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def assume_assistant(res, assistant_dict: Dict[str, Any]):
6868
for key, value in assistant_dict.items():
6969
if key == "error":
7070
pass
71+
elif key == 'system_prompt_template' and isinstance(value, str):
72+
pytest.assume(res[key] == [assistant_dict[key]])
7173
else:
7274
pytest.assume(res[key] == assistant_dict[key])
7375

test/config.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# text_model_id = os.getenv("text_model_id")
44
# chat_model_id = os.getenv("chat_model_id")
55

6-
text_model_id = "jTJxv3iQ"
7-
chat_model_id = "Pxjizpc5"
8-
TASKINGAI_API_KEY = "taHAGKN5nNYdfAw4VtDVDXq7WXriyzsd"
6+
# text_model_id = "fTfk462c"
7+
chat_model_id = "KnnBZsjH"
8+
sleep_time = 1
9+
nums = (i+1 for i in range(10))
10+
text_model_id = "mF4PYMaR"
11+
# TASKINGAI_API_KEY = "tag4rNUwc7sYBjTjXtGNe6WbGNhI056C"

test/data/test_assistant_data.yml

Lines changed: 294 additions & 107 deletions
Large diffs are not rendered by default.

test/data/test_retrieval_data.yml

Whitespace-only changes.

test/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33

44
if __name__ == "__main__":
55
pytest.main(['-m sync', '--clean-alluredir', '--alluredir=./test/report'])
6-
pytest.main(['-m a_sync', '--alluredir=./test/report'])
6+
# pytest.main(['-m a_sync', '--alluredir=./test/report'])
7+
# pytest.main(['-m bulk', '--clean-alluredir', '--alluredir=./test/report'])
78
os.system("allure serve ./test/report")

test/pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ testpaths = test/testcase/
77
markers =
88
sync: sync test
99
a_sync: async test
10+
bulk: bulk test
1011

1112
log_cli = False
1213

test/testcase/test_async/conftest.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,24 @@ async def a_record_id(a_collection_id):
4444
return record_id
4545

4646

47-
@pytest.fixture(scope="function")
48-
async def a_function_id():
49-
res = await a_list_functions()
50-
function_id = res[0].function_id
51-
return function_id
47+
# @pytest.fixture(scope="function")
48+
# async def a_function_id():
49+
# res = await a_list_functions()
50+
# function_id = res[0].function_id
51+
# return function_id
5252

5353

54-
@pytest.fixture(scope="function")
55-
async def a_function():
56-
res = await a_list_functions()
57-
function = res[0]
58-
return function
54+
# @pytest.fixture(scope="function")
55+
# async def a_function():
56+
# res = await a_list_functions()
57+
# function = res[0]
58+
# return function
5959

6060

6161
@pytest.fixture(scope="function")
6262
async def a_action_id():
6363
res = await a_list_actions()
64-
action_id = res[0].action_id
64+
action_id = res[-1].action_id
6565
return action_id
6666

6767

0 commit comments

Comments
 (0)