Spaces:
Paused
Paused
Download backend/tests/test_api/test_tools.py from NeerajCodz/scrapeRL: direct link, hf CLI and curl.
- Browser
- Download file 725 Bytes
-
https://huggingface.co/spaces/NeerajCodz/scrapeRL/resolve/main/backend/tests/test_api/test_tools.py
- Command line
-
hf download hf://spaces/NeerajCodz/scrapeRL/backend/tests/test_api/test_tools.py
-
curl -L -o test_tools.py https://huggingface.co/spaces/NeerajCodz/scrapeRL/resolve/main/backend/tests/test_api/test_tools.py
725 Bytes
| """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] | |