Skip to content

Commit 233c960

Browse files
committed
Directly compare query string lists
A comparison of the two lists should do the same thing as comparing the length and then zipping and comparing each of the tuples
1 parent e00316a commit 233c960

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

responses.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -270,17 +270,7 @@ def _url_matches_strict(self, url, other):
270270
url_qsl = sorted(parse_qsl(url_parsed.query))
271271
other_qsl = sorted(parse_qsl(other_parsed.query))
272272

273-
if len(url_qsl) != len(other_qsl):
274-
return False
275-
276-
for (a_k, a_v), (b_k, b_v) in zip(url_qsl, other_qsl):
277-
if a_k != b_k:
278-
return False
279-
280-
if a_v != b_v:
281-
return False
282-
283-
return True
273+
return url_qsl == other_qsl
284274

285275
def _should_match_querystring(self, match_querystring_argument):
286276
if match_querystring_argument is not _unspecified:

0 commit comments

Comments
 (0)