Spaces:
Build error
Build error
| # 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 | |