mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Test: Added test cases for List Chunks HTTP API (#6514)
### What problem does this PR solve? cover [list chunks](https://ragflow.io/docs/v0.17.2/http_api_reference#list-chunks) endpoints ### Type of change - [x] update test cases
This commit is contained in:
@ -20,7 +20,10 @@ from common import batch_create_datasets, delete_dataset
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def get_dataset_ids(get_http_api_auth):
|
||||
ids = batch_create_datasets(get_http_api_auth, 5)
|
||||
yield ids
|
||||
delete_dataset(get_http_api_auth)
|
||||
def get_dataset_ids(get_http_api_auth, request):
|
||||
def cleanup():
|
||||
delete_dataset(get_http_api_auth)
|
||||
|
||||
request.addfinalizer(cleanup)
|
||||
|
||||
return batch_create_datasets(get_http_api_auth, 5)
|
||||
|
||||
@ -65,14 +65,14 @@ class TestDatasetList:
|
||||
100,
|
||||
0,
|
||||
"1064",
|
||||
marks=pytest.mark.xfail(reason="issues/5851"),
|
||||
marks=pytest.mark.skip(reason="issues/5851"),
|
||||
),
|
||||
pytest.param(
|
||||
{"page": "a", "page_size": 2},
|
||||
100,
|
||||
0,
|
||||
"""ValueError("invalid literal for int() with base 10: \'a\'")""",
|
||||
marks=pytest.mark.xfail(reason="issues/5851"),
|
||||
marks=pytest.mark.skip(reason="issues/5851"),
|
||||
),
|
||||
],
|
||||
)
|
||||
@ -97,14 +97,14 @@ class TestDatasetList:
|
||||
100,
|
||||
0,
|
||||
"1064",
|
||||
marks=pytest.mark.xfail(reason="issues/5851"),
|
||||
marks=pytest.mark.skip(reason="issues/5851"),
|
||||
),
|
||||
pytest.param(
|
||||
{"page_size": "a"},
|
||||
100,
|
||||
0,
|
||||
"""ValueError("invalid literal for int() with base 10: \'a\'")""",
|
||||
marks=pytest.mark.xfail(reason="issues/5851"),
|
||||
marks=pytest.mark.skip(reason="issues/5851"),
|
||||
),
|
||||
],
|
||||
)
|
||||
@ -149,14 +149,14 @@ class TestDatasetList:
|
||||
0,
|
||||
lambda r: (is_sorted(r["data"]["docs"], "name", False)),
|
||||
"",
|
||||
marks=pytest.mark.xfail(reason="issues/5851"),
|
||||
marks=pytest.mark.skip(reason="issues/5851"),
|
||||
),
|
||||
pytest.param(
|
||||
{"orderby": "unknown"},
|
||||
102,
|
||||
0,
|
||||
"orderby should be create_time or update_time",
|
||||
marks=pytest.mark.xfail(reason="issues/5851"),
|
||||
marks=pytest.mark.skip(reason="issues/5851"),
|
||||
),
|
||||
],
|
||||
)
|
||||
@ -232,7 +232,7 @@ class TestDatasetList:
|
||||
102,
|
||||
0,
|
||||
"desc should be true or false",
|
||||
marks=pytest.mark.xfail(reason="issues/5851"),
|
||||
marks=pytest.mark.skip(reason="issues/5851"),
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
@ -67,7 +67,7 @@ class TestDatasetUpdate:
|
||||
100,
|
||||
"""AttributeError("\'NoneType\' object has no attribute \'strip\'")""",
|
||||
),
|
||||
pytest.param("", 102, "", marks=pytest.mark.xfail(reason="issue#5915")),
|
||||
pytest.param("", 102, "", marks=pytest.mark.skip(reason="issue/5915")),
|
||||
("dataset_1", 102, "Duplicated dataset name in updating dataset."),
|
||||
("DATASET_1", 102, "Duplicated dataset name in updating dataset."),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user