diff --git a/api/tests/test_openapi_routes.py b/api/tests/test_openapi_routes.py index bf47e58..fee970c 100644 --- a/api/tests/test_openapi_routes.py +++ b/api/tests/test_openapi_routes.py @@ -63,6 +63,11 @@ EXPECTED_ROUTES: dict[str, set[str]] = { # форма ББ/ОФР (Срез 3b; PATCH и accept добавит Task 6) "/api/v1/documents/{document_id}/statement": {"get", "patch"}, "/api/v1/documents/{document_id}/statement/checks/accept": {"post"}, + # quality-metrics (AURORA-1759) + "/api/v1/quality-metrics/matrix": {"get"}, + "/api/v1/quality-metrics/series": {"get"}, + "/api/v1/quality-metrics/cells/{cell}/documents": {"get"}, + "/api/v1/quality-metrics/export": {"get"}, # consolidations-api (Срез 4) "/api/v1/consolidations": {"post"}, "/api/v1/company-groups/{group_id}/consolidations": {"get"}, @@ -109,6 +114,7 @@ CHECKED_PREFIXES = ( "/api/v1/documents", "/api/v1/consolidations", "/api/v1/company-groups", + "/api/v1/quality-metrics", ) # Модели, которые обязаны быть в схеме ровно один раз под коротким именем @@ -309,3 +315,16 @@ def test_retry_routes_declare_different_conflicts(schema: dict[str, Any]) -> Non ] assert "FILE_NOT_RETRYABLE" in single and "MAX_ATTEMPTS_REACHED" in single assert batch == "VERSION_NOT_EDITABLE" + + +def test_quality_metrics_routes_declare_documented_query_parameters(schema: dict[str, Any]) -> None: + """Query-параметры метрик качества: ряд — `cause`, ячейки — `limit`/`offset`, выгрузка — `format`, `filters` нет.""" + + def names(path: str) -> set[str]: + return {p["name"] for p in schema["paths"][f"/api/v1/quality-metrics{path}"]["get"].get("parameters", [])} + + assert "cause" in names("/series") + assert {"limit", "offset"} <= names("/cells/{cell}/documents") + assert "format" in names("/export") + for path in ("/matrix", "/series", "/cells/{cell}/documents", "/export"): + assert "filters" not in names(path), path