feat(lotto): run_forward_purchase 3전략 구매·채점·저장
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -90,6 +90,22 @@ def test_backfill_calibration_idempotent(monkeypatch):
|
||||
assert r3["calibrated"] == 0
|
||||
|
||||
|
||||
def test_run_forward_purchase_persists_all_strategies(monkeypatch):
|
||||
db = _fresh_db(monkeypatch)
|
||||
_seed_draws(db, 40)
|
||||
from app import backtest as bt
|
||||
# 작은 규모로 빠르게
|
||||
res = bt.run_forward_purchase(draw_no=40, k=20, pool_n=500, sample_seed=5)
|
||||
assert res["ok"] is True
|
||||
rows = db.get_backtest_runs(draw_no=40)
|
||||
strategies = {r["strategy"] for r in rows}
|
||||
assert "random_null" in strategies
|
||||
assert "coverage" in strategies
|
||||
assert "engine_w" in strategies # base 가중치로 최소 1건
|
||||
for r in rows:
|
||||
assert r["n_tickets"] == 20
|
||||
|
||||
|
||||
def test_get_calibrated_draw_nos(monkeypatch):
|
||||
"""저장된 draw_no 집합이 get_calibrated_draw_nos에 포함되어야 한다."""
|
||||
db = _fresh_db(monkeypatch)
|
||||
|
||||
Reference in New Issue
Block a user