Files
sciagent/be0/tests/test_dashboard_lookup_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

32 lines
927 B
Python

"""
GET /api/conferences and /api/supervisors — dashboard filter lookups.
Run: cd be0 && python -m unittest tests.test_dashboard_lookup_routes -v
"""
from __future__ import annotations
import unittest
from unittest.mock import patch
class DashboardLookupRoutesTests(unittest.TestCase):
def test_no_db_returns_empty_lists(self) -> None:
from fastapi.testclient import TestClient
from main import app
from src.initiative_db import engine as eng
with patch.object(eng, "is_postgres_enabled", return_value=False):
client = TestClient(app)
r1 = client.get("/api/conferences")
r2 = client.get("/api/supervisors")
self.assertEqual(r1.status_code, 200, r1.text)
self.assertEqual(r2.status_code, 200, r2.text)
self.assertEqual(r1.json(), [])
self.assertEqual(r2.json(), [])
if __name__ == "__main__":
unittest.main()