Spaces:
Running
Running
File size: 725 Bytes
46eecf4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | """Tests for tool endpoints."""
import pytest
from fastapi.testclient import TestClient
def test_list_tools(client: TestClient) -> None:
"""Test listing available tools."""
response = client.get("/api/tools/registry")
assert response.status_code == 200
data = response.json()
assert "tools" in data
def test_tool_test_endpoint(client: TestClient) -> None:
"""Test tool testing endpoint."""
test_request = {
"tool_name": "navigate_to",
"parameters": {"url": "https://example.com"},
"dry_run": True,
}
response = client.post("/api/tools/test", json=test_request)
# Either success or tool not found is acceptable
assert response.status_code in [200, 404]
|