Skip to content

Commit 02e5791

Browse files
committed
test: add test
1 parent 3b08d41 commit 02e5791

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

test/testcase/test_sync/test_sync_retrieval.py

+27-20
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ def test_update_record_by_text(self, collection_id, record_id, text_splitter):
248248
res = update_record(**update_record_data)
249249
res_dict = vars(res)
250250
assume_record_result(update_record_data, res_dict)
251-
time.sleep(2)
252-
records = list_records(collection_id=collection_id, order="desc", limit=20, after=None, before=None)
251+
253252

254253
@pytest.mark.run(order=34)
255254
@pytest.mark.parametrize("text_splitter", text_splitter_list)
@@ -268,8 +267,7 @@ def test_update_record_by_web(self, collection_id, record_id, text_splitter):
268267
res = update_record(**update_record_data)
269268
res_dict = vars(res)
270269
assume_record_result(update_record_data, res_dict)
271-
time.sleep(2)
272-
records = list_records(collection_id=collection_id, order="desc", limit=20, after=None, before=None)
270+
273271

274272
@pytest.mark.run(order=35)
275273
@pytest.mark.parametrize("upload_file_data", upload_file_data_list[2:3])
@@ -295,8 +293,7 @@ def test_update_record_by_file(self, collection_id, record_id, upload_file_data)
295293
res = update_record(**update_record_data)
296294
res_dict = vars(res)
297295
assume_record_result(update_record_data, res_dict)
298-
time.sleep(2)
299-
records = list_records(collection_id=collection_id, order="desc", limit=20, after=None, before=None)
296+
300297

301298
@pytest.mark.run(order=79)
302299
def test_delete_record(self, collection_id):
@@ -339,6 +336,7 @@ def test_query_chunks(self, collection_id):
339336

340337
@pytest.mark.run(order=42)
341338
def test_create_chunk(self, collection_id):
339+
time.sleep(2)
342340
# Create a chunk.
343341
create_chunk_data = {
344342
"collection_id": collection_id,
@@ -399,23 +397,32 @@ def test_update_chunk(self, collection_id, chunk_id):
399397
res = update_chunk(**update_chunk_data)
400398
res_dict = vars(res)
401399
assume_chunk_result(update_chunk_data, res_dict)
402-
records = list_records(collection_id=collection_id, order="desc", limit=20, after=None, before=None)
400+
403401

404402
@pytest.mark.run(order=46)
405-
def test_delete_chunk(self, collection_id):
403+
def test_delete_chunk(self, collection_id, chunk_id):
406404
# List chunks.
407405

408-
chunks = list_chunks(collection_id=collection_id, limit=5)
409-
for index, chunk in enumerate(chunks):
410-
chunk_id = chunk.chunk_id
411-
412-
# Delete a chunk.
413-
414-
delete_chunk(collection_id=collection_id, chunk_id=chunk_id)
406+
# chunks = list_chunks(collection_id=collection_id, limit=5)
407+
# for index, chunk in enumerate(chunks):
408+
# chunk_id = chunk.chunk_id
409+
#
410+
# # Delete a chunk.
411+
#
412+
# delete_chunk(collection_id=collection_id, chunk_id=chunk_id)
413+
#
414+
# # List chunks.
415+
#
416+
# new_chunks = list_chunks(collection_id=collection_id)
417+
# chunk_ids = [chunk.chunk_id for chunk in new_chunks]
418+
# pytest.assume(chunk_id not in chunk_ids)
419+
# records = list_records(collection_id=collection_id, order="desc", limit=20, after=None, before=None)
420+
# for record in records:
421+
delete_chunk(collection_id=collection_id, chunk_id=chunk_id)
415422

416-
# List chunks.
423+
# List chunks.
417424

418-
new_chunks = list_chunks(collection_id=collection_id)
419-
chunk_ids = [chunk.chunk_id for chunk in new_chunks]
420-
pytest.assume(chunk_id not in chunk_ids)
421-
records = list_records(collection_id=collection_id, order="desc", limit=20, after=None, before=None)
425+
new_chunks = list_chunks(collection_id=collection_id)
426+
chunk_ids = [chunk.chunk_id for chunk in new_chunks]
427+
pytest.assume(chunk_id not in chunk_ids)
428+
records = list_records(collection_id=collection_id, order="desc", limit=20, after=None, before=None)

0 commit comments

Comments
 (0)