df921f13cd
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
662 B
Python
27 lines
662 B
Python
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"]
|