Repository navigation
test(functions): assert FindInMap rejects non-DefaultValue 4th item without transform - #4639
Merged
kddejong merged 1 commit intoAug 14, 2026
Conversation
…ithout transform
Now that maxItems is unconditionally 4, add a guardrail test proving the
prefixItems[3] object check still rejects a 4th element that isn't a
{DefaultValue: ...} object even without the AWS::LanguageExtensions
transform.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4639 +/- ##
=======================================
Coverage 94.58% 94.58%
=======================================
Files 432 432
Lines 15417 15417
Branches 2986 2986
=======================================
Hits 14582 14582
Misses 456 456
Partials 379 379
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
Follow-up to #4628, which made
Fn::FindInMapmaxItemsunconditionally 4 so aDefaultValue4th element is accepted without theAWS::LanguageExtensionstransform.This adds a regression/guardrail test asserting that a 4th element which is not a
{DefaultValue: ...}object is still rejected viaprefixItems[3]('notanobject' is not of type 'object') even without the transform — locking in that relaxing the arity did not weaken the 4th-element shape check.Test-only change; no runtime behavior change.
Validation
pytest test/unit/rules/functions/test_find_in_map.py -qruff check/ruff format --checkon the changed file