MAESTRO: add security ops red tests

This commit is contained in:
Mariusz Banach
2026-02-18 04:03:23 +01:00
parent 902211ac69
commit 0f5f300c69
5 changed files with 395 additions and 0 deletions

View 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())