Enterprise-AI-Copilot / tests /unit /test_monitoring.py
Punit1's picture
Initial commit
939c0c0
Raw History Blame Contribute Delete
598 Bytes
"""
Unit tests for Health Check & Deep Diagnostic Endpoints.
"""
from __future__ import annotations
import pytest
from httpx import AsyncClient
@pytest.mark.asyncio
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"]