Skip to content

Commit 7aa6bdb

Browse files
committed
test: add test
1 parent 4012805 commit 7aa6bdb

File tree

2 files changed

+37
-35
lines changed

2 files changed

+37
-35
lines changed

test/testcase/test_async/test_async_retrieval.py

+18-17
Original file line numberDiff line numberDiff line change
@@ -212,23 +212,24 @@ async def test_a_get_record(self):
212212
pytest.assume(res_dict["record_id"] == self.record_id)
213213
# pytest.assume(res_dict["status"] == "ready")
214214

215-
# @pytest.mark.run(order=34)
216-
# @pytest.mark.asyncio
217-
# @pytest.mark.parametrize("text_splitter", text_splitter_list)
218-
# async def test_a_update_record_by_text(self, text_splitter):
219-
# # Update a record.
220-
#
221-
# update_record_data = {
222-
# "collection_id": self.collection_id,
223-
# "record_id": self.record_id,
224-
# "content": "TaskingAI is an AI-native application development platform that unifies modules like Model, Retrieval, Assistant, and Tool into one seamless ecosystem, streamlining the creation and deployment of applications for developers.",
225-
# "text_splitter": text_splitter,
226-
# "metadata": {"test": "test"},
227-
# }
228-
# res = await a_update_record(**update_record_data)
229-
# logger.info(f"a_update_record:{res}")
230-
# res_dict = vars(res)
231-
# assume_record_result(update_record_data, res_dict)
215+
@pytest.mark.run(order=34)
216+
@pytest.mark.asyncio
217+
@pytest.mark.parametrize("text_splitter", text_splitter_list)
218+
async def test_a_update_record_by_text(self, text_splitter):
219+
# Update a record.
220+
221+
update_record_data = {
222+
"collection_id": self.collection_id,
223+
"record_id": self.record_id,
224+
"content": "TaskingAI is an AI-native application development platform that unifies modules like Model, Retrieval, Assistant, and Tool into one seamless ecosystem, streamlining the creation and deployment of applications for developers.",
225+
"text_splitter": text_splitter,
226+
"metadata": {"test": "test"},
227+
}
228+
res = await a_update_record(**update_record_data)
229+
logger.info(f"a_update_record:{res}")
230+
res_dict = vars(res)
231+
assume_record_result(update_record_data, res_dict)
232+
records = list_records(collection_id=self.collection_id, order="desc", limit=20, after=None, before=None)
232233

233234
# @pytest.mark.run(order=34)
234235
# @pytest.mark.asyncio

test/testcase/test_sync/test_sync_retrieval.py

+19-18
Original file line numberDiff line numberDiff line change
@@ -231,23 +231,24 @@ def test_get_record(self, collection_id):
231231
pytest.assume(res_dict["record_id"] == record_id)
232232
# pytest.assume(res_dict["status"] == "ready")
233233

234-
# @pytest.mark.run(order=34)
235-
# @pytest.mark.parametrize("text_splitter", text_splitter_list)
236-
# def test_update_record_by_text(self, collection_id, record_id, text_splitter):
237-
# # Update a record.
238-
#
239-
# update_record_data = {
240-
# "type": "text",
241-
# "title": "TaskingAI",
242-
# "collection_id": collection_id,
243-
# "record_id": record_id,
244-
# "content": "TaskingAI is an AI-native application development platform that unifies modules like Model, Retrieval, Assistant, and Tool into one seamless ecosystem, streamlining the creation and deployment of applications for developers.",
245-
# "text_splitter": text_splitter,
246-
# "metadata": {"test": "test"},
247-
# }
248-
# res = update_record(**update_record_data)
249-
# res_dict = vars(res)
250-
# assume_record_result(update_record_data, res_dict)
234+
@pytest.mark.run(order=34)
235+
@pytest.mark.parametrize("text_splitter", text_splitter_list)
236+
def test_update_record_by_text(self, collection_id, record_id, text_splitter):
237+
# Update a record.
238+
239+
update_record_data = {
240+
"type": "text",
241+
"title": "TaskingAI",
242+
"collection_id": collection_id,
243+
"record_id": record_id,
244+
"content": "TaskingAI is an AI-native application development platform that unifies modules like Model, Retrieval, Assistant, and Tool into one seamless ecosystem, streamlining the creation and deployment of applications for developers.",
245+
"text_splitter": text_splitter,
246+
"metadata": {"test": "test"},
247+
}
248+
res = update_record(**update_record_data)
249+
res_dict = vars(res)
250+
assume_record_result(update_record_data, res_dict)
251+
records = list_records(collection_id=collection_id, order="desc", limit=20, after=None, before=None)
251252

252253
# @pytest.mark.run(order=34)
253254
# @pytest.mark.parametrize("text_splitter", text_splitter_list)
@@ -295,7 +296,7 @@ def test_get_record(self, collection_id):
295296
@pytest.mark.run(order=79)
296297
def test_delete_record(self, collection_id):
297298
# List records.
298-
time.sleep(Config.sleep_time)
299+
# time.sleep(Config.sleep_time)
299300
records = list_records(collection_id=collection_id, order="desc", limit=20, after=None, before=None)
300301
old_nums = len(records)
301302
for index, record in enumerate(records):

0 commit comments

Comments
 (0)