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:
@@ -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"]
|
||||
Reference in New Issue
Block a user