paper-dynasty-database/tests
Cal Corum fe3dc0e4d2 feat: WP-08 evaluate endpoint and evolution evaluator service (#73)
Closes #73

Adds POST /api/v2/evolution/cards/{card_id}/evaluate — force-recalculates
a card's evolution state from career totals (SUM across all
player_season_stats rows for the player-team pair).

Changes:
- app/services/evolution_evaluator.py: evaluate_card() function that
  aggregates career stats, delegates to formula engine for value/tier
  computation, updates evolution_card_state with no-regression guarantee
- app/routers_v2/evolution.py: POST /cards/{card_id}/evaluate endpoint
  plus existing GET /tracks and GET /tracks/{id} endpoints (WP-06)
- tests/test_evolution_evaluator.py: 15 unit tests covering tier
  assignment, advancement, partial progress, idempotency, fully evolved,
  no regression, multi-season aggregation, missing state error, and
  return shape
- tests/__init__.py, tests/conftest.py: shared test infrastructure

All 15 tests pass. Models and formula engine are lazily imported so
this module is safely importable before WP-01/WP-05/WP-07/WP-09 merge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 15:31:44 -05:00
..
__init__.py feat: evolution track seed data and tests (WP-03) (#68) 2026-03-12 17:35:12 -05:00
conftest.py feat: add ProcessedGame ledger for full idempotency in update_season_stats() (#105) 2026-03-18 01:05:31 -05:00
test_evolution_evaluator.py feat: WP-08 evaluate endpoint and evolution evaluator service (#73) 2026-03-18 15:31:44 -05:00
test_evolution_models.py test: add Phase 1a test suite (25 tests) 2026-03-17 19:33:49 -05:00
test_evolution_seed.py test: add Phase 1a test suite (25 tests) 2026-03-17 19:33:49 -05:00
test_evolution_track_api.py feat: Track Catalog API endpoints (WP-06) (#71) 2026-03-12 20:40:38 -05:00
test_formula_engine.py fix: align tier_from_value with DB model field names (t1_threshold) 2026-03-18 15:07:07 -05:00
test_season_stats_model.py refactor: deduplicate pitcher formula and test constants 2026-03-17 09:49:33 -05:00
test_season_stats_update.py feat: add ProcessedGame ledger for full idempotency in update_season_stats() (#105) 2026-03-18 01:05:31 -05:00