Repository navigation
matchers/query: match repeated query parameter values in order - #4
Merged
Merged
Conversation
Every expected value was compared against every received value, so ?x=a&x=b never matched. List values now match pairwise and by count. Taken from h2non#187. Co-authored-by: bensynapse <118375461+bensynapse@users.noreply.github.com>
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
A query parameter sent more than once could never match a mock. Both
.params({"x": ["a", "b"]})and a mock URL ending in?x=a&x=bfailed against a request for?x=a&x=b, because each expected value was compared against every received value, soavsbalways failed.List values are now compared position by position, and the number of values must match. A single value behaves as before: it must equal every value received for that key. Taken from h2non#187.
Worth a look: one case gets stricter.
["a", "a"]used to match any number ofas and now needs exactly two.Full suite passes (299 passed, 3 xfailed).
PR Checklist
params()docstring now explains lists vs single values)