File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,28 @@ def test_ctor(self):
144
144
'Version parameter must be a string or None. Found float'
145
145
)
146
146
147
+ def test_url_valid_resource (self ):
148
+ url = self .client ._url ('/hello/{0}/world' , 'somename' )
149
+ self .assertEqual (
150
+ url , '{0}{1}' .format (url_prefix , 'hello/somename/world' )
151
+ )
152
+
153
+ url = self .client ._url ('/hello/{0}/world' , '/some?name' )
154
+ self .assertEqual (
155
+ url , '{0}{1}' .format (url_prefix , 'hello/%2Fsome%3Fname/world' )
156
+ )
157
+
158
+ def test_url_invalid_resource (self ):
159
+ with pytest .raises (ValueError ):
160
+ self .client ._url ('/hello/{0}/world' , ['sakuya' , 'izayoi' ])
161
+
162
+ def test_url_no_resource (self ):
163
+ url = self .client ._url ('/simple' )
164
+ self .assertEqual (url , '{0}{1}' .format (url_prefix , 'simple' ))
165
+
166
+ url = self .client ._url ('/simple' , None )
167
+ self .assertEqual (url , '{0}{1}' .format (url_prefix , 'simple' ))
168
+
147
169
#########################
148
170
# INFORMATION TESTS #
149
171
#########################
You can’t perform that action at this time.
0 commit comments