sciagent code + Gitea Actions CI/CD
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"""Sanity checks for admin audit router registration (no DB required)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class AdminAuditRouterSmokeTests(unittest.TestCase):
|
||||
def test_audit_router_registers_list_and_detail(self) -> None:
|
||||
from src.admin_audit_routes import router
|
||||
|
||||
paths = [getattr(r, "path", "") for r in router.routes]
|
||||
self.assertIn("/admin/audit", paths)
|
||||
self.assertTrue(
|
||||
any(isinstance(p, str) and p.startswith("/admin/audit/") for p in paths),
|
||||
msg=f"detail route missing under router, paths={paths}",
|
||||
)
|
||||
|
||||
def test_parse_sort_behavior(self) -> None:
|
||||
from src.admin_audit_routes import _parse_sort
|
||||
|
||||
self.assertFalse(_parse_sort("occurred_at:desc"))
|
||||
self.assertTrue(_parse_sort("occurred_at:asc"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user