Spaces:
Build error
Build error
Download tests/test_web.py from Varun2007/pageparse.ai: direct link, hf CLI and curl.
- Browser
- Download file 941 Bytes
-
https://huggingface.co/spaces/Varun2007/pageparse.ai/resolve/main/tests/test_web.py
- Command line
-
hf download hf://spaces/Varun2007/pageparse.ai/tests/test_web.py
-
curl -L -o test_web.py https://huggingface.co/spaces/Varun2007/pageparse.ai/resolve/main/tests/test_web.py
941 Bytes
| # SPDX-FileCopyrightText: 2026 Team Centurions | |
| # SPDX-License-Identifier: AGPL-3.0-or-later | |
| from fastapi.testclient import TestClient | |
| from pageparse.web import app | |
| client = TestClient(app) | |
| def test_index(): | |
| resp = client.get("/") | |
| assert resp.status_code == 200 | |
| def test_telemetry(): | |
| resp = client.get("/telemetry") | |
| assert resp.status_code == 200 | |
| data = resp.json() | |
| assert "cpu_percent" in data | |
| def test_pages(): | |
| resp = client.get("/pages") | |
| assert resp.status_code == 200 | |
| def test_get_tasks(): | |
| resp = client.get("/tasks") | |
| assert resp.status_code == 200 | |
| def test_get_tasks_with_priority(): | |
| resp = client.get("/tasks?priority=high") | |
| assert resp.status_code == 200 | |
| def test_patch_task(): | |
| resp = client.patch("/tasks/1", json={"status": "done"}) | |
| assert resp.status_code == 200 | |
| def test_delete_task(): | |
| resp = client.delete("/tasks/1") | |
| assert resp.status_code == 200 | |