Download tests/unit/test_monitoring.py from Punit1/Enterprise-AI-Copilot: direct link, hf CLI and curl.
- Browser
- Download file 598 Bytes
-
https://huggingface.co/spaces/Punit1/Enterprise-AI-Copilot/resolve/main/tests/unit/test_monitoring.py
- Command line
-
hf download hf://spaces/Punit1/Enterprise-AI-Copilot/tests/unit/test_monitoring.py
-
curl -L -o test_monitoring.py https://huggingface.co/spaces/Punit1/Enterprise-AI-Copilot/resolve/main/tests/unit/test_monitoring.py
598 Bytes
| """ | |
| Unit tests for Health Check & Deep Diagnostic Endpoints. | |
| """ | |
| from __future__ import annotations | |
| import pytest | |
| from httpx import AsyncClient | |
| async def test_health_diag_endpoint(client: AsyncClient): | |
| """Test deep health diagnostic endpoint returns status for DB, Qdrant, and Cache.""" | |
| response = await client.get("/health/diag") | |
| assert response.status_code == 200 | |
| data = response.json() | |
| assert "database" in data | |
| assert "qdrant" in data | |
| assert "cache" in data | |
| assert "overall" in data | |
| assert data["overall"] in ["healthy", "degraded"] | |