sciagent code + Gitea Actions CI/CD
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
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()
|
||||
Reference in New Issue
Block a user