paper-dynasty-database/tests
Cal Corum 569dc53c00 test: add Tier 1 and Tier 2 refractor system test cases
Implements all gap tests identified in the PO review for the refractor
card progression system (Phase 1 foundation).

TIER 1 (critical):
- T1-1: Negative singles guard in compute_batter_value — documents that
  hits=1, doubles=1, triples=1 produces singles=-1 and flows through
  unclamped (value=8.0, not 10.0)
- T1-2: SP tier boundary precision with floats — outs=29 (IP=9.666) stays
  T0, outs=30 (IP=10.0) promotes to T1; also covers T2 float boundary
- T1-3: evaluate-game with non-existent game_id returns 200 with empty results
- T1-4: Seed threshold ordering + positivity invariant (t1<t2<t3<t4, all >0)

TIER 2 (high):
- T2-1: fully_evolved=True persists when stats are zeroed or drop below
  previous tier — no-regression applies to both tier and fully_evolved flag
- T2-2: Parametrized edge cases for _determine_card_type: DH, C, 2B, empty
  string, None, and compound "SP/RP" (resolves to "sp", SP checked first)
- T2-3: evaluate-game with zero StratPlay rows returns empty batch result
- T2-4: GET /teams/{id}/refractors with valid team and zero states is empty
- T2-5: GET /teams/99999/refractors documents 200+empty (no team existence check)
- T2-6: POST /cards/{id}/evaluate with zero season stats stays at T0 value=0.0
- T2-9: Per-player error isolation — patches source module so router's local
  from-import picks up the patched version; one failure, one success = evaluated=1
- T2-10: Each card_type has exactly one RefractorTrack after seeding

All 101 tests pass (15 PostgreSQL-only tests skip without POSTGRES_HOST).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 09:02:30 -05:00
..
__init__.py feat: evolution track seed data and tests (WP-03) (#68) 2026-03-12 17:35:12 -05:00
conftest.py refactor: rename evolution system to refractor 2026-03-23 13:31:55 -05:00
test_formula_engine.py test: add Tier 1 and Tier 2 refractor system test cases 2026-03-24 09:02:30 -05:00
test_postgame_refractor.py test: add Tier 1 and Tier 2 refractor system test cases 2026-03-24 09:02:30 -05:00
test_refractor_evaluator.py test: add Tier 1 and Tier 2 refractor system test cases 2026-03-24 09:02:30 -05:00
test_refractor_init.py test: add Tier 1 and Tier 2 refractor system test cases 2026-03-24 09:02:30 -05:00
test_refractor_models.py refactor: rename evolution system to refractor 2026-03-23 13:31:55 -05:00
test_refractor_seed.py test: add Tier 1 and Tier 2 refractor system test cases 2026-03-24 09:02:30 -05:00
test_refractor_state_api.py test: add Tier 1 and Tier 2 refractor system test cases 2026-03-24 09:02:30 -05:00
test_refractor_track_api.py refactor: rename evolution system to refractor 2026-03-23 13:31:55 -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 fix: stale docstring + add decision-only pitcher test 2026-03-19 10:31:16 -05:00