File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 11import json
22import unittest
3- from urllib .parse import urlparse , parse_qs
3+ from collections import Counter
4+ from urllib .parse import urlparse , parse_qsl
45from pytest_httpserver import HTTPServer
56from linebot .v3 .messaging import (
67 Configuration ,
@@ -157,12 +158,15 @@ def test_list_coupon(self):
157158
158159 request , _ = httpserver .log [0 ]
159160 parsed_url = urlparse (request .url )
160- query_params = parse_qs (parsed_url .query )
161161
162- self .assertIn ("status" , query_params )
163- self .assertIn ("limit" , query_params )
164- self .assertEqual (query_params ["status" ], ["RUNNING" , "CLOSED" ])
165- self .assertEqual (query_params ["limit" ], ["10" ])
162+ actual_params = parse_qsl (parsed_url .query , keep_blank_values = True )
163+ expected_params = [
164+ ("status" , "RUNNING" ),
165+ ("status" , "CLOSED" ),
166+ ("start" , "startToken" ),
167+ ("limit" , "10" ),
168+ ]
169+ self .assertEqual (Counter (actual_params ), Counter (expected_params ))
166170
167171 def test_get_coupon_detail (self ):
168172 expected_coupon_id = "COUPON123"
You can’t perform that action at this time.
0 commit comments