mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-04 17:45:07 +08:00
Fix(test): Update error message assertions for unsupported content type tests (#12901)
### What problem does this PR solve? This commit updates test cases for create, delete, and update dataset endpoints to expect consistent error messages when an unsupported content type is provided. ### Type of change - [x] Bug Fix (test)
This commit is contained in:
@ -53,7 +53,7 @@ class TestRquest:
|
|||||||
BAD_CONTENT_TYPE = "text/xml"
|
BAD_CONTENT_TYPE = "text/xml"
|
||||||
res = create_dataset(HttpApiAuth, {"name": "bad_content_type"}, headers={"Content-Type": BAD_CONTENT_TYPE})
|
res = create_dataset(HttpApiAuth, {"name": "bad_content_type"}, headers={"Content-Type": BAD_CONTENT_TYPE})
|
||||||
assert res["code"] == 101, res
|
assert res["code"] == 101, res
|
||||||
assert "Field: <name>" in res["message"], res
|
assert res["message"] == f"Unsupported content type: Expected application/json, got {BAD_CONTENT_TYPE}", res
|
||||||
|
|
||||||
@pytest.mark.p3
|
@pytest.mark.p3
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
|||||||
@ -51,7 +51,7 @@ class TestRquest:
|
|||||||
BAD_CONTENT_TYPE = "text/xml"
|
BAD_CONTENT_TYPE = "text/xml"
|
||||||
res = delete_datasets(HttpApiAuth, headers={"Content-Type": BAD_CONTENT_TYPE})
|
res = delete_datasets(HttpApiAuth, headers={"Content-Type": BAD_CONTENT_TYPE})
|
||||||
assert res["code"] == 101, res
|
assert res["code"] == 101, res
|
||||||
assert "Field: <ids>" in res["message"], res
|
assert res["message"] == f"Unsupported content type: Expected application/json, got {BAD_CONTENT_TYPE}", res
|
||||||
|
|
||||||
@pytest.mark.p3
|
@pytest.mark.p3
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class TestRquest:
|
|||||||
BAD_CONTENT_TYPE = "text/xml"
|
BAD_CONTENT_TYPE = "text/xml"
|
||||||
res = update_dataset(HttpApiAuth, dataset_id, {"name": "bad_content_type"}, headers={"Content-Type": BAD_CONTENT_TYPE})
|
res = update_dataset(HttpApiAuth, dataset_id, {"name": "bad_content_type"}, headers={"Content-Type": BAD_CONTENT_TYPE})
|
||||||
assert res["code"] == 101, res
|
assert res["code"] == 101, res
|
||||||
assert res["message"] == "No properties were modified", res
|
assert res["message"] == f"Unsupported content type: Expected application/json, got {BAD_CONTENT_TYPE}", res
|
||||||
|
|
||||||
@pytest.mark.p3
|
@pytest.mark.p3
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
|||||||
Reference in New Issue
Block a user