dy-dashboard/tests/test_operation_logs_p2.py
2026-10-28 11:14:17 +08:00

14 lines
789 B
Python

"""操作日志P2治理功能。"""
import unittest
from pathlib import Path
R=Path(__file__).resolve().parents[1]
G=(R/'services/audit_governance.py').read_text();D=(R/'routes/dashboard.py').read_text();A=(R/'static/js/app.js').read_text()
class T(unittest.TestCase):
def test_governance_tables(self):
self.assertIn('audit_alerts',G);self.assertIn('audit_retention_config',G);self.assertIn('integrity_hash',G)
def test_governance_endpoints(self):
for x in ('governance/summary','/api/logs/alerts','/api/logs/anomalies','/api/logs/reports','integrity/verify','/api/logs/retention'):self.assertIn(x,D)
def test_governance_ui(self):
self.assertIn('审计治理中心',A);self.assertIn('verifyOperationLogs',A);self.assertIn('保留策略',A)
if __name__=='__main__':unittest.main()