File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 1
1
import json
2
2
import unittest
3
- from urllib .parse import urlparse , parse_qs
3
+ from collections import Counter
4
+ from urllib .parse import urlparse , parse_qsl
4
5
from pytest_httpserver import HTTPServer
5
6
from linebot .v3 .messaging import (
6
7
Configuration ,
@@ -157,12 +158,14 @@ def test_list_coupon(self):
157
158
158
159
request , _ = httpserver .log [0 ]
159
160
parsed_url = urlparse (request .url )
160
- query_params = parse_qs (parsed_url .query )
161
161
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
+ ("limit" , "10" ),
167
+ ]
168
+ self .assertEqual (Counter (actual_params ), Counter (expected_params ))
166
169
167
170
def test_get_coupon_detail (self ):
168
171
expected_coupon_id = "COUPON123"
You can’t perform that action at this time.
0 commit comments