feat(stock-lab): /snapshot/refresh + /runs 리스트·상세 라우터
This commit is contained in:
@@ -122,3 +122,25 @@ def test_run_manual_save_writes_row(client):
|
||||
c = sqlite3.connect(db_path)
|
||||
cnt = c.execute("SELECT count(*) FROM screener_runs").fetchone()[0]
|
||||
assert cnt == 1
|
||||
|
||||
|
||||
def test_runs_list_and_detail(client):
|
||||
db_path = os.environ["STOCK_DB_PATH"]
|
||||
c = sqlite3.connect(db_path)
|
||||
_seed_min(c)
|
||||
c.close()
|
||||
|
||||
saved = client.post(
|
||||
"/api/stock/screener/run",
|
||||
json={"mode": "manual_save", "asof": "2026-05-12"},
|
||||
).json()
|
||||
run_id = saved["run_id"]
|
||||
|
||||
list_r = client.get("/api/stock/screener/runs?limit=5")
|
||||
assert list_r.status_code == 200
|
||||
assert any(r["id"] == run_id for r in list_r.json())
|
||||
|
||||
detail = client.get(f"/api/stock/screener/runs/{run_id}")
|
||||
assert detail.status_code == 200
|
||||
assert detail.json()["meta"]["id"] == run_id
|
||||
assert isinstance(detail.json()["results"], list)
|
||||
|
||||
Reference in New Issue
Block a user