mirror of
https://github.com/mgeeky/decode-spam-headers.git
synced 2026-02-22 13:33:30 +01:00
MAESTRO: add security ops red tests
This commit is contained in:
26
backend/tests/api/test_health.py
Normal file
26
backend/tests/api/test_health.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
from app.engine.scanner_registry import ScannerRegistry
|
||||
from app.main import app
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_health_endpoint_returns_status() -> None:
|
||||
registry = ScannerRegistry()
|
||||
|
||||
async with AsyncClient(
|
||||
transport=ASGITransport(app=app),
|
||||
base_url="http://test",
|
||||
) as client:
|
||||
response = await client.get("/api/health")
|
||||
|
||||
assert response.status_code == 200
|
||||
payload = response.json()
|
||||
|
||||
assert payload["status"] in {"up", "degraded", "down"}
|
||||
assert payload["version"]
|
||||
assert payload["uptime"] >= 0
|
||||
assert payload["scannerCount"] == len(registry.list_tests())
|
||||
Reference in New Issue
Block a user