File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,8 @@ def _generate_auth_url(path, params):
263
263
264
264
if type (params ) is dict :
265
265
params = sorted (dict (** params ).items ())
266
+ elif params is None :
267
+ return path
266
268
267
269
return path + "?" + _urlencode_params (params )
268
270
Original file line number Diff line number Diff line change @@ -114,6 +114,23 @@ def test_dry_run(self):
114
114
115
115
self .assertEqual (0 , len (responses .calls ))
116
116
117
+ @responses .activate
118
+ def test_no_get_parameter (self ):
119
+
120
+ responses .add (responses .POST ,
121
+ 'https://api.openrouteservice.org/directions' ,
122
+ body = '{"status":"OK","results":[]}' ,
123
+ status = 200 ,
124
+ content_type = 'application/json' )
125
+
126
+ req = self .client .request (post_json = {},
127
+ url = 'v2/directions/driving-car/json' ,
128
+ dry_run = 'true' )
129
+
130
+ self .assertEqual (0 , len (responses .calls ))
131
+
132
+ # Test if the client works with a post request without a get parameter
133
+
117
134
@responses .activate
118
135
def test_key_in_header (self ):
119
136
# Test that API key is being put in the Authorization header
You can’t perform that action at this time.
0 commit comments