mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
fix(api): stop returning 204 with response body and add CI check (#36489)
This commit is contained in:
1 parent
f19702f76c
commit
ea5e487d3c
29 files changed
+46
-46
No files matched your search
@@ -873,7 +873,7 @@ class TestDatasetApiDelete:
|
||||
result, status = method(api, dataset_id)
|
||||
|
||||
assert status == 204
|
||||
assert result == {"result": "success"}
|
||||
assert result == ""
|
||||
|
||||
def test_delete_forbidden_no_permission(self, app: Flask):
|
||||
api = DatasetApi()
|
||||
@@ -1687,7 +1687,7 @@ class TestDatasetApiDeleteApi:
|
||||
response, status = method(api, "api-key-id")
|
||||
|
||||
assert status == 204
|
||||
assert response["result"] == "success"
|
||||
assert response == ""
|
||||
|
||||
def test_delete_key_not_found(self, app: Flask):
|
||||
api = DatasetApiDeleteApi()
|
||||
|
||||
@@ -940,7 +940,7 @@ class TestChildChunkUpdateApi:
|
||||
response, status = method(api, "ds-1", "doc-1", "seg-1", "cc-1")
|
||||
|
||||
assert status == 204
|
||||
assert response["result"] == "success"
|
||||
assert response == ""
|
||||
|
||||
def test_delete_child_chunk_index_error(self, app: Flask):
|
||||
api = ChildChunkUpdateApi()
|
||||
|
||||
@@ -327,7 +327,7 @@ class TestInstalledAppApi:
|
||||
resp, status = method(installed_app)
|
||||
|
||||
assert status == 204
|
||||
assert resp["result"] == "success"
|
||||
assert resp == ""
|
||||
|
||||
def test_delete_owned_by_current_tenant(self, tenant_id: str):
|
||||
api = module.InstalledAppApi()
|
||||
|
||||
@@ -141,7 +141,7 @@ class TestSavedMessageApi:
|
||||
|
||||
delete_mock.assert_called_once()
|
||||
assert status == 204
|
||||
assert result == {"result": "success"}
|
||||
assert result == ""
|
||||
|
||||
def test_delete_not_completion_app(self):
|
||||
api = module.SavedMessageApi()
|
||||
|
||||
@@ -242,5 +242,5 @@ def test_api_based_extension_detail_delete_removes_extension(app: Flask, monkeyp
|
||||
response, status = APIBasedExtensionDetailAPI().delete(extension_id)
|
||||
|
||||
delete_mock.assert_called_once_with(existing_extension)
|
||||
assert response == {"result": "success"}
|
||||
assert status == 204
|
||||
assert response == ""
|
||||
@@ -179,8 +179,8 @@ class TestModelProviderCredentialApi:
|
||||
):
|
||||
result, status = method(api, provider="openai")
|
||||
|
||||
assert result["result"] == "success"
|
||||
assert status == 204
|
||||
assert result == ""
|
||||
|
||||
|
||||
class TestModelProviderCredentialSwitchApi:
|
||||
|
||||
Reference in new issue
Block a user