Add test for document (#3548)

### What problem does this PR solve?

Add test for document

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Co-authored-by: liuhua <10215101452@stu.ecun.edu.cn>
This commit is contained in:
liuhua
2024-11-21 12:02:26 +08:00
committed by GitHub
parent 0ac6dc8f8c
commit c7c8b3812f
21 changed files with 406 additions and 31 deletions

View File

@ -115,6 +115,7 @@ def upload(dataset_id, tenant_id):
return get_result(
message="No file selected!", code=settings.RetCode.ARGUMENT_ERROR
)
'''
# total size
total_size = 0
for file_obj in file_objs:
@ -127,6 +128,7 @@ def upload(dataset_id, tenant_id):
message=f"Total file size exceeds 10MB limit! ({total_size / (1024 * 1024):.2f} MB)",
code=settings.RetCode.ARGUMENT_ERROR,
)
'''
e, kb = KnowledgebaseService.get_by_id(dataset_id)
if not e:
raise LookupError(f"Can't find the dataset with ID {dataset_id}!")