mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
create dataset (#2074)
### What problem does this PR solve? You can use sdk to create a dataset ### Type of change - [x] New Feature --------- Co-authored-by: root <root@xwg>
This commit is contained in:
23
sdk/python/test/t_dataset.py
Normal file
23
sdk/python/test/t_dataset.py
Normal file
@ -0,0 +1,23 @@
|
||||
from ragflow import RAGFlow
|
||||
|
||||
from common import API_KEY, HOST_ADDRESS
|
||||
from test_sdkbase import TestSdk
|
||||
|
||||
|
||||
class TestDataset(TestSdk):
|
||||
def test_create_dataset_with_success(self):
|
||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||
ds = rag.create_dataset("God")
|
||||
assert ds is not None, "The dataset creation failed, returned None."
|
||||
assert ds.name == "God", "Dataset name does not match."
|
||||
|
||||
def test_delete_one_file(self):
|
||||
"""
|
||||
Test deleting one file with success.
|
||||
"""
|
||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||
ds = rag.create_dataset("ABC")
|
||||
assert ds is not None, "Failed to create dataset"
|
||||
assert ds.name == "ABC", "Dataset name mismatch"
|
||||
delete_result = ds.delete()
|
||||
assert delete_result is True, "Failed to delete dataset"
|
||||
Reference in New Issue
Block a user