|
|
|
@@ -135,12 +135,7 @@ class TestDatasetUpdate: |
|
|
|
("knowledge_graph", 0, ""), |
|
|
|
("email", 0, ""), |
|
|
|
("tag", 0, ""), |
|
|
|
pytest.param( |
|
|
|
"", |
|
|
|
0, |
|
|
|
"", |
|
|
|
marks=pytest.mark.xfail(reason="issue#5920"), |
|
|
|
), |
|
|
|
("", 0, ""), |
|
|
|
( |
|
|
|
"other_chunk_method", |
|
|
|
102, |
|
|
|
@@ -148,12 +143,6 @@ class TestDatasetUpdate: |
|
|
|
" 'paper', 'book', 'laws', 'presentation', 'picture', 'one', " |
|
|
|
"'knowledge_graph', 'email', 'tag']", |
|
|
|
), |
|
|
|
pytest.param( |
|
|
|
None, |
|
|
|
0, |
|
|
|
"", |
|
|
|
marks=pytest.mark.xfail(reason="issue#5920"), |
|
|
|
), |
|
|
|
], |
|
|
|
) |
|
|
|
def test_chunk_method( |
|
|
|
@@ -210,7 +199,7 @@ class TestDatasetUpdate: |
|
|
|
[ |
|
|
|
("me", 0), |
|
|
|
("team", 0), |
|
|
|
pytest.param("", 0, marks=pytest.mark.xfail(reason="issue#5920")), |
|
|
|
("", 0), |
|
|
|
("ME", 102), |
|
|
|
("TEAM", 102), |
|
|
|
("other_permission", 102), |
|
|
|
@@ -249,58 +238,31 @@ class TestDatasetUpdate: |
|
|
|
"payload, expected_code, expected_message", |
|
|
|
[ |
|
|
|
({"chunk_count": 1}, 102, "Can't change `chunk_count`."), |
|
|
|
pytest.param( |
|
|
|
( |
|
|
|
{"create_date": "Tue, 11 Mar 2025 13:37:23 GMT"}, |
|
|
|
102, |
|
|
|
"", |
|
|
|
marks=pytest.mark.xfail(reason="issue#5923"), |
|
|
|
), |
|
|
|
pytest.param( |
|
|
|
{"create_time": 1741671443322}, |
|
|
|
102, |
|
|
|
"", |
|
|
|
marks=pytest.mark.xfail(reason="issue#5923"), |
|
|
|
), |
|
|
|
pytest.param( |
|
|
|
{"created_by": "aa"}, |
|
|
|
102, |
|
|
|
"", |
|
|
|
marks=pytest.mark.xfail(reason="issue#5923"), |
|
|
|
"The input parameters are invalid.", |
|
|
|
), |
|
|
|
({"create_time": 1741671443322}, 102, "The input parameters are invalid."), |
|
|
|
({"created_by": "aa"}, 102, "The input parameters are invalid."), |
|
|
|
({"document_count": 1}, 102, "Can't change `document_count`."), |
|
|
|
({"id": "id"}, 102, "The input parameters are invalid."), |
|
|
|
pytest.param( |
|
|
|
{"status": "1"}, 102, "", marks=pytest.mark.xfail(reason="issue#5923") |
|
|
|
), |
|
|
|
({"status": "1"}, 102, "The input parameters are invalid."), |
|
|
|
( |
|
|
|
{"tenant_id": "e57c1966f99211efb41e9e45646e0111"}, |
|
|
|
102, |
|
|
|
"Can't change `tenant_id`.", |
|
|
|
), |
|
|
|
pytest.param( |
|
|
|
{"token_num": 1}, 102, "", marks=pytest.mark.xfail(reason="issue#5923") |
|
|
|
), |
|
|
|
pytest.param( |
|
|
|
({"token_num": 1}, 102, "The input parameters are invalid."), |
|
|
|
( |
|
|
|
{"update_date": "Tue, 11 Mar 2025 13:37:23 GMT"}, |
|
|
|
102, |
|
|
|
"", |
|
|
|
marks=pytest.mark.xfail(reason="issue#5923"), |
|
|
|
), |
|
|
|
pytest.param( |
|
|
|
{"update_time": 1741671443339}, |
|
|
|
102, |
|
|
|
"", |
|
|
|
marks=pytest.mark.xfail(reason="issue#5923"), |
|
|
|
), |
|
|
|
pytest.param( |
|
|
|
{"unknown_field": 0}, |
|
|
|
100, |
|
|
|
"", |
|
|
|
marks=pytest.mark.xfail(reason="issue#5923"), |
|
|
|
"The input parameters are invalid.", |
|
|
|
), |
|
|
|
({"update_time": 1741671443339}, 102, "The input parameters are invalid."), |
|
|
|
], |
|
|
|
) |
|
|
|
def test_modify_unsupported_field( |
|
|
|
def test_modify_read_only_field( |
|
|
|
self, get_http_api_auth, payload, expected_code, expected_message |
|
|
|
): |
|
|
|
ids = create_datasets(get_http_api_auth, 1) |
|
|
|
@@ -308,6 +270,11 @@ class TestDatasetUpdate: |
|
|
|
assert res["code"] == expected_code |
|
|
|
assert res["message"] == expected_message |
|
|
|
|
|
|
|
def test_modify_unknown_field(self, get_http_api_auth): |
|
|
|
ids = create_datasets(get_http_api_auth, 1) |
|
|
|
res = update_dataset(get_http_api_auth, ids[0], {"unknown_field": 0}) |
|
|
|
assert res["code"] == 100 |
|
|
|
|
|
|
|
def test_concurrent_update(self, get_http_api_auth): |
|
|
|
ids = create_datasets(get_http_api_auth, 1) |
|
|
|
|