Make server tool http based
This commit is contained in:
@@ -288,6 +288,10 @@ class TestToolResourceCRUD:
|
||||
"description": "抓取页面并提取正文",
|
||||
"category": "query",
|
||||
"icon": "Globe",
|
||||
"http_method": "GET",
|
||||
"http_url": "https://example.com/search",
|
||||
"http_headers": {},
|
||||
"http_timeout_ms": 10000,
|
||||
"enabled": True,
|
||||
})
|
||||
assert create_resp.status_code == 200
|
||||
@@ -315,6 +319,16 @@ class TestToolResourceCRUD:
|
||||
missing_resp = client.get(f"/api/tools/resources/{tool_id}")
|
||||
assert missing_resp.status_code == 404
|
||||
|
||||
def test_create_query_tool_requires_http_url(self, client):
|
||||
resp = client.post("/api/tools/resources", json={
|
||||
"name": "缺失URL的查询工具",
|
||||
"description": "应当失败",
|
||||
"category": "query",
|
||||
"icon": "Globe",
|
||||
"enabled": True,
|
||||
})
|
||||
assert resp.status_code == 400
|
||||
|
||||
def test_system_tool_can_be_updated_and_deleted(self, client):
|
||||
list_resp = client.get("/api/tools/resources")
|
||||
assert list_resp.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user