refactor
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# [DEF:backend.tests.test_dashboards_api:Module]
|
||||
# @TIER: STANDARD
|
||||
# @PURPOSE: Contract-driven tests for Dashboard Hub API
|
||||
# @LAYER: Domain (Tests)
|
||||
# @SEMANTICS: tests, dashboards, api, contract
|
||||
# @RELATION: TESTS -> backend.src.api.routes.dashboards
|
||||
|
||||
from fastapi.testclient import TestClient
|
||||
@@ -48,6 +50,8 @@ def test_get_dashboards_success():
|
||||
# Validate against Pydantic model
|
||||
DashboardsResponse(**data)
|
||||
|
||||
# [/DEF:test_get_dashboards_success:Function]
|
||||
|
||||
# [DEF:test_get_dashboards_env_not_found:Function]
|
||||
# @TEST: GET /api/dashboards returns 404 if env_id missing
|
||||
# @PRE: env_id does not exist
|
||||
@@ -64,4 +68,6 @@ def test_get_dashboards_env_not_found():
|
||||
assert response.status_code == 404
|
||||
assert "Environment not found" in response.json()["detail"]
|
||||
|
||||
# [/DEF:test_get_dashboards_env_not_found:Function]
|
||||
|
||||
# [/DEF:backend.tests.test_dashboards_api:Module]
|
||||
|
||||
@@ -44,4 +44,6 @@ async def test_get_dashboards_with_status():
|
||||
assert result[0]["last_task"]["task_id"] == "task-123"
|
||||
assert result[0]["last_task"]["status"] == "RUNNING"
|
||||
|
||||
# [/DEF:test_get_dashboards_with_status:Function]
|
||||
|
||||
# [/DEF:backend.tests.test_resource_service:Module]
|
||||
|
||||
Reference in New Issue
Block a user