Files
sciagent/be0/tests/test_admin_audit_routes.py
T
Thinh Lam 688fac73e9
CI/CD / backend (push) Failing after 2m8s
CI/CD / frontend (push) Failing after 1m40s
CI/CD / deploy (push) Has been skipped
sciagent code + Gitea Actions CI/CD
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 09:38:30 +07:00

28 lines
867 B
Python

"""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()