Revert "Refactor: dataset / kb API to RESTFul style" (#13646)

Reverts infiniflow/ragflow#13619
This commit is contained in:
Jin Hai
2026-03-17 12:09:48 +08:00
committed by GitHub
parent fdf2d84ffc
commit 986dcf1cc8
53 changed files with 1207 additions and 1721 deletions

View File

@ -44,7 +44,7 @@ class TestAutoMetadataOnCreate:
dataset = client.create_dataset(**payload)
# The SDK should expose parser_config via internal properties or metadata;
# we rely on the HTTP API for verification via get_auto_metadata.
cfg = dataset.get_auto_metadata()
cfg = client.get_auto_metadata(dataset_id=dataset.id)
assert cfg["enabled"] is True
assert len(cfg["fields"]) == 2
names = {f["name"] for f in cfg["fields"]}
@ -74,7 +74,7 @@ class TestAutoMetadataOnUpdate:
}
dataset.update(payload)
cfg = dataset.get_auto_metadata()
cfg = client.get_auto_metadata(dataset_id=dataset.id)
assert cfg["enabled"] is True
assert len(cfg["fields"]) == 1
assert cfg["fields"][0]["name"] == "tags"
@ -93,9 +93,9 @@ class TestAutoMetadataOnUpdate:
}
],
}
dataset.update_auto_metadata(**update_cfg)
client.update_auto_metadata(dataset_id=dataset.id, **update_cfg)
cfg2 = dataset.get_auto_metadata()
cfg2 = client.get_auto_metadata(dataset_id=dataset.id)
assert cfg2["enabled"] is False
assert len(cfg2["fields"]) == 1
assert cfg2["fields"][0]["name"] == "year"

View File

@ -31,8 +31,8 @@ class TestAuthorization:
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[
(None, "<Unauthorized '401: Unauthorized'>"),
(INVALID_API_TOKEN, "<Unauthorized '401: Unauthorized'>"),
(None, "Authentication error: API key is invalid!"),
(INVALID_API_TOKEN, "Authentication error: API key is invalid!"),
],
ids=["empty_auth", "invalid_api_token"],
)

View File

@ -27,8 +27,8 @@ class TestAuthorization:
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[
(None, "<Unauthorized '401: Unauthorized'>"),
(INVALID_API_TOKEN, "<Unauthorized '401: Unauthorized'>"),
(None, "Authentication error: API key is invalid!"),
(INVALID_API_TOKEN, "Authentication error: API key is invalid!"),
],
)
def test_auth_invalid(self, invalid_auth, expected_message):

View File

@ -26,8 +26,8 @@ class TestAuthorization:
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[
(None, "<Unauthorized '401: Unauthorized'>"),
(INVALID_API_TOKEN, "<Unauthorized '401: Unauthorized'>"),
(None, "Authentication error: API key is invalid!"),
(INVALID_API_TOKEN, "Authentication error: API key is invalid!"),
],
)
def test_auth_invalid(self, invalid_auth, expected_message):