Rebuild: FastAPI skeleton with health, domains, run status and the auth seam

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rockdrigo
2026-11-24 11:18:08 -06:00
commit df921f13cd
7 changed files with 106 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
from dagster import DagsterRunStatus
from fastapi.testclient import TestClient
from webapi.main import app, dagster
class FakeDagster:
def get_run_status(self, run_id):
return DagsterRunStatus.SUCCESS
def test_health():
assert TestClient(app).get("/health").json() == {"status": "ok"}
def test_run_status_reads_dagster():
app.dependency_overrides[dagster] = FakeDagster
try:
r = TestClient(app).get("/runs/abc")
finally:
app.dependency_overrides.clear()
assert r.json() == {"id": "abc", "status": "SUCCESS"}
def test_domains():
assert TestClient(app).get("/domains").json() == ["cacu", "cama", "tea"]