Reject non-integer Advanced Commerce offer period counts - #216
Open
Shubham-Padkonde wants to merge 1 commit into
Open
Shubham-Padkonde wants to merge 1 commit into
Shubham-Padkonde wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AdvancedCommerceOffer(periodCount=1.5, ...),periodCount=float('nan'), andperiodCount=Truecurrently pass validation even though the API requires an integer number of periods. Range comparisons alone do not enforce that contract, and comparisons with NaN are both false.Require an integer, excluding booleans, before checking the existing 1–12 range. Tests cover constructing the public model with invalid values and every valid period count. Six regression cases fail before the change.
Validation: 223 offline tests pass on Python 3.12. The full 224-test run has one unrelated live OCSP connection-reset error (
test_apple_chain_is_valid_with_ocsp_and_strict); the remaining tests pass.