[verified] Add API tests for /api/v1/learning/factors + configurable history dir
Closes reviewer suggestion (deleg_5dd358e3): adds coverage for the factor readiness endpoint (n_points / learnable / last_value / ordering) and the min_points 400 validation. FACTOR_HISTORY_DIR is now configurable via app config so tests (and deploy) can point the history store at a chosen path instead of a hardcoded data dir. 236 tests pass.
This commit is contained in:
@@ -790,7 +790,9 @@ def create_app(config: dict[str, Any] | None = None) -> Flask:
|
||||
"""
|
||||
from app import factors as factors_mod
|
||||
from app.factor_history import FactorHistory
|
||||
fh = FactorHistory(Path(__file__).resolve().parents[1] / "data" / "factor_history")
|
||||
hist_dir = app.config.get("FACTOR_HISTORY_DIR") or (
|
||||
Path(__file__).resolve().parents[1] / "data" / "factor_history")
|
||||
fh = FactorHistory(hist_dir)
|
||||
try:
|
||||
min_points = max(int(request.args.get("min_points", "12")), 0)
|
||||
except (TypeError, ValueError):
|
||||
|
||||
Reference in New Issue
Block a user