Feat/max age validation - #417
Conversation
WalkthroughAge validation now rejects computed ages below 18 or above 99 while preserving the existing error message and successful return value. Tests update related birth-date fixtures and add frozen-time cases for overage rejection and valid input. The package version is incremented to Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #417 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 16 16
Lines 1510 1510
=========================================
Hits 1510 1510
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/test_types.py (1)
510-520: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover the inclusive age boundaries.
Add cases for exactly 18 and 99 years old (for example, July 27, 2008 and July 27, 1927 under the existing frozen date) to lock in the new boundary contract.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_types.py` around lines 510 - 520, Extend the validate_age_requirement tests with cases for users exactly 18 and exactly 99 years old under the existing 2026-07-27 freeze. Use July 27, 2008 and July 27, 1927, and assert both dates are accepted and returned unchanged, preserving the inclusive age boundaries.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_types.py`:
- Line 496: Update the stale comment near the request date-of-birth setup to
state that the date represents a valid age and that the test is verifying the
missing state_of_birth error, while leaving the test data unchanged.
---
Nitpick comments:
In `@tests/test_types.py`:
- Around line 510-520: Extend the validate_age_requirement tests with cases for
users exactly 18 and exactly 99 years old under the existing 2026-07-27 freeze.
Use July 27, 2008 and July 27, 1927, and assert both dates are accepted and
returned unchanged, preserving the inclusive age boundaries.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5aa07abf-532b-4441-b313-f798ea5f5059
📒 Files selected for processing (3)
cuenca_validations/types/helpers.pycuenca_validations/version.pytests/test_types.py
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/test_types.py (1)
510-522: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAdd tests for the inclusive age boundaries.
The new tests cover overage and an interior valid age, but not exactly 18 or 99. Add frozen-time cases for
1927-07-27(99) and2008-07-27(18) to verify both limits remain accepted.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_types.py` around lines 510 - 522, Extend the age validation tests around validate_age_requirement with frozen-time cases for birth dates 1927-07-27 and 2008-07-27, asserting both return the original date without raising. Keep the existing overage and interior valid-age tests unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@tests/test_types.py`:
- Around line 510-522: Extend the age validation tests around
validate_age_requirement with frozen-time cases for birth dates 1927-07-27 and
2008-07-27, asserting both return the original date without raising. Keep the
existing overage and interior valid-age tests unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 385db5c7-de85-403c-8d9e-029815d02c24
📒 Files selected for processing (1)
tests/test_types.py
Summary by CodeRabbit