fix: update test limit to respect MAX_LIMIT=500 (#110) #112
No reviewers
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-database#112
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "issue/110-fix-test-batting-sbaplayer-career-totals-returns-4"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #110
Summary
test_batting_sbaplayer_career_totalswas sendinglimit=999toGET /api/v3/plays/batting, butMAX_LIMIT = 500(set independencies.py). FastAPI'sQuery(..., le=MAX_LIMIT)validation on thelimitparameter correctly rejected the out-of-range value with a 422.Fix: Changed
limit=999tolimit=500in the test. A player's season count will never approach 500, so the test logic (career PA ≥ max single-season PA) is unaffected.Files Changed
tests/integration/test_stratplay_routes.py— line 572:limit: 999→limit: 500Other observations
MAX_LIMITto 1000 for play endpoints specifically. If that lands,limit=500in this test will remain valid (500 ≤ 1000).AI Code Review
Files Reviewed
tests/integration/test_stratplay_routes.py(modified)Findings
Correctness
No issues found.
MAX_LIMIT = 500is confirmed atapp/dependencies.py:63. The oldlimit=999exceeded that cap, causing FastAPI'sQuery(..., le=MAX_LIMIT)validation to return 422. Changing tolimit=500aligns with the constraint. The test's assertion logic (career PA ≥ max single-season PA) is unaffected — no SBA player will ever have 500 distinct seasons, so the limit is never the binding constraint.Security
No issues found.
Style & Conventions
No issues found. Single-line change, no formatting noise.
Suggestions
MAX_LIMITis raised to 1000 for play endpoints,limit=500will remain valid (500 ≤ 1000). No follow-up needed.Verdict: APPROVED
Minimal, correct fix.
limit=500satisfiesle=MAX_LIMITwhile being orders of magnitude above any realistic season count per player. Note: posting as COMMENT because Gitea blocks self-approval.Automated review by Claude PR Reviewer
b980367b8cto36b962e5d5