@@ -147,11 +147,11 @@ def test_not_found_on_get(self):
147
147
self .assertRaises (self .error_responses [404 ], self .cs .countries )
148
148
149
149
def test_other_client_error_on_get (self ):
150
- self .cs .stub_request ('countries.json' , None , status = 418 )
150
+ self .cs .stub_request ('countries.json' , 'sample_client_error.json' , status = 418 )
151
151
self .assertRaises (self .error_responses [418 ], self .cs .countries )
152
152
153
153
def test_server_error_on_get (self ):
154
- self .cs .stub_request ('countries.json' , None , status = 500 )
154
+ self .cs .stub_request ('countries.json' , 'sample_server_error.json' , status = 500 )
155
155
self .assertRaises (self .error_responses [500 ], self .cs .countries )
156
156
157
157
def test_bad_request_on_post (self ):
@@ -176,13 +176,13 @@ def test_not_found_on_post(self):
176
176
177
177
def test_other_client_error_on_post (self ):
178
178
client = Client (self .cs .auth_details , "uhiuhiuhiuhiuhiuhiuh" )
179
- client .stub_request ('clients.json' , None , status = 418 )
179
+ client .stub_request ('clients.json' , 'sample_client_error.json' , status = 418 )
180
180
self .assertRaises (self .error_responses [418 ], client .create , "Client Company Name" ,
181
181
"(GMT+10:00) Canberra, Melbourne, Sydney" , "Australia" )
182
182
183
183
def test_server_error_on_post (self ):
184
184
client = Client (self .cs .auth_details , "uhiuhiuhiuhiuhiuhiuh" )
185
- client .stub_request ('clients.json' , None , status = 500 )
185
+ client .stub_request ('clients.json' , 'sample_server_error.json' , status = 500 )
186
186
self .assertRaises (self .error_responses [500 ], client .create , "Client Company Name" ,
187
187
"(GMT+10:00) Canberra, Melbourne, Sydney" , "Australia" )
188
188
@@ -210,14 +210,14 @@ def test_not_found_on_put(self):
210
210
def test_other_client_error_on_put (self ):
211
211
template = Template (self .cs .auth_details , "uhiuhiuhiuhiuhiuhiuh" )
212
212
template .stub_request (
213
- 'templates/uhiuhiuhiuhiuhiuhiuh.json' , None , status = 418 )
213
+ 'templates/uhiuhiuhiuhiuhiuhiuh.json' , 'sample_client_error.json' , status = 418 )
214
214
self .assertRaises (self .error_responses [418 ], template .update , "Template One Updated" , "http://templates.org/index.html" ,
215
215
"http://templates.org/files.zip" )
216
216
217
217
def test_server_error_on_put (self ):
218
218
template = Template (self .cs .auth_details , "uhiuhiuhiuhiuhiuhiuh" )
219
219
template .stub_request (
220
- 'templates/uhiuhiuhiuhiuhiuhiuh.json' , None , status = 500 )
220
+ 'templates/uhiuhiuhiuhiuhiuhiuh.json' , 'sample_server_error.json' , status = 500 )
221
221
self .assertRaises (self .error_responses [500 ], template .update , "Template One Updated" , "http://templates.org/index.html" ,
222
222
"http://templates.org/files.zip" )
223
223
@@ -242,13 +242,13 @@ def test_not_found_on_delete(self):
242
242
def test_other_client_error_on_delete (self ):
243
243
template = Template (self .cs .auth_details , "uhiuhiuhiuhiuhiuhiuh" )
244
244
template .stub_request (
245
- 'templates/uhiuhiuhiuhiuhiuhiuh.json' , None , status = 418 )
245
+ 'templates/uhiuhiuhiuhiuhiuhiuh.json' , 'sample_client_error.json' , status = 418 )
246
246
self .assertRaises (self .error_responses [418 ], template .delete )
247
247
248
248
def test_server_error_on_delete (self ):
249
249
template = Template (self .cs .auth_details , "uhiuhiuhiuhiuhiuhiuh" )
250
250
template .stub_request (
251
- 'templates/uhiuhiuhiuhiuhiuhiuh.json' , None , status = 500 )
251
+ 'templates/uhiuhiuhiuhiuhiuhiuh.json' , 'sample_server_error.json' , status = 500 )
252
252
self .assertRaises (self .error_responses [500 ], template .delete )
253
253
254
254
0 commit comments