feat(governance): 新增 AI 技術雷達滾動監控
Some checks failed
Code Review / ai-code-review (push) Successful in 13s
CD Pipeline / tests (push) Successful in 1m39s
CD Pipeline / build-and-deploy (push) Successful in 4m35s
CD Pipeline / post-deploy-checks (push) Successful in 1m51s
Ansible / Reboot Recovery Contract / validate (push) Has been cancelled
Some checks failed
Code Review / ai-code-review (push) Successful in 13s
CD Pipeline / tests (push) Successful in 1m39s
CD Pipeline / build-and-deploy (push) Successful in 4m35s
CD Pipeline / post-deploy-checks (push) Successful in 1m51s
Ansible / Reboot Recovery Contract / validate (push) Has been cancelled
This commit is contained in:
35
apps/api/tests/test_ai_technology_radar_readback_api.py
Normal file
35
apps/api/tests/test_ai_technology_radar_readback_api.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from src.api.v1.agents import router
|
||||
|
||||
|
||||
def test_ai_technology_radar_readback_endpoint_returns_committed_snapshot():
|
||||
app = FastAPI()
|
||||
app.include_router(router, prefix="/api/v1")
|
||||
client = TestClient(app)
|
||||
|
||||
response = client.get("/api/v1/agents/ai-technology-radar-readback")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert data["schema_version"] == "ai_technology_radar_readback_v1"
|
||||
assert data["summary"]["overall_completion_percent"] == 42.2
|
||||
assert data["summary"]["ai_technology_radar_completion_percent"] == 100.0
|
||||
assert data["summary"]["technology_count"] == 20
|
||||
assert data["summary"]["source_count"] == 47
|
||||
assert data["summary"]["source_failures"] == 0
|
||||
assert data["policy"]["read_only"] is True
|
||||
assert data["policy"]["sdk_installation_approved"] is False
|
||||
assert data["policy"]["telegram_send_approved"] is False
|
||||
assert data["policy"]["openclaw_replacement_approved"] is False
|
||||
|
||||
serialized = json.dumps(data, ensure_ascii=False)
|
||||
assert "/Users/" not in serialized
|
||||
assert ".claude/projects" not in serialized
|
||||
assert ".codex" not in serialized
|
||||
assert "192.168." not in serialized
|
||||
Reference in New Issue
Block a user