@@ -30,15 +30,15 @@ def assertEqualHeaders(self, first, second, msg=None):
3030class TrueHttpEntryTestCase (HttpTestCase ):
3131 @mocketize
3232 def test_truesendall (self ):
33- url = "http://httpbin.org /ip"
33+ url = "http://httpbin.local /ip"
3434 resp = urlopen (url )
3535 self .assertEqual (resp .code , 200 )
3636 resp = requests .get (url )
3737 self .assertEqual (resp .status_code , 200 )
3838
3939 @mocketize (truesocket_recording_dir = recording_directory )
4040 def test_truesendall_with_recording (self ):
41- url = "http://httpbin.org /ip"
41+ url = "http://httpbin.local /ip"
4242
4343 urlopen (url )
4444 requests .get (url )
@@ -54,11 +54,11 @@ def test_truesendall_with_recording(self):
5454 with io .open (dump_filename ) as f :
5555 responses = json .load (f )
5656
57- self .assertEqual (len (responses ["httpbin.org " ]["80" ].keys ()), 2 )
57+ self .assertEqual (len (responses ["httpbin.local " ]["80" ].keys ()), 2 )
5858
5959 @mocketize (truesocket_recording_dir = recording_directory )
6060 def test_truesendall_with_gzip_recording (self ):
61- url = "http://httpbin.org /gzip"
61+ url = "http://httpbin.local /gzip"
6262
6363 requests .get (url )
6464 resp = requests .get (url )
@@ -70,11 +70,11 @@ def test_truesendall_with_gzip_recording(self):
7070 with io .open (dump_filename ) as f :
7171 responses = json .load (f )
7272
73- assert len (responses ["httpbin.org " ]["80" ].keys ()) == 1
73+ assert len (responses ["httpbin.local " ]["80" ].keys ()) == 1
7474
7575 @mocketize (truesocket_recording_dir = recording_directory )
7676 def test_truesendall_with_chunk_recording (self ):
77- url = "http://httpbin.org /range/70000?chunk_size=65536"
77+ url = "http://httpbin.local /range/70000?chunk_size=65536"
7878
7979 requests .get (url )
8080 resp = requests .get (url )
@@ -86,12 +86,14 @@ def test_truesendall_with_chunk_recording(self):
8686 with io .open (dump_filename ) as f :
8787 responses = json .load (f )
8888
89- assert len (responses ["httpbin.org " ]["80" ].keys ()) == 1
89+ assert len (responses ["httpbin.local " ]["80" ].keys ()) == 1
9090
9191 @mocketize
9292 def test_wrongpath_truesendall (self ):
93- Entry .register (Entry .GET , "http://httpbin.org/user.agent" , Response (status = 404 ))
94- response = urlopen ("http://httpbin.org/ip" )
93+ Entry .register (
94+ Entry .GET , "http://httpbin.local/user.agent" , Response (status = 404 )
95+ )
96+ response = urlopen ("http://httpbin.local/ip" )
9597 self .assertEqual (response .code , 200 )
9698
9799
@@ -205,7 +207,7 @@ def test_mockhttp_entry_collect_duplicates(self):
205207
206208 @mocketize
207209 def test_multipart (self ):
208- url = "http://httpbin.org /post"
210+ url = "http://httpbin.local /post"
209211 data = '--xXXxXXyYYzzz\r \n Content-Disposition: form-data; name="content"\r \n Content-Type: text/plain; charset=utf-8\r \n Content-Length: 68\r \n \r \n Action: comment\n Text: Comment with attach\n Attachment: x1.txt, x2.txt\r \n --xXXxXXyYYzzz\r \n Content-Disposition: form-data; name="attachment_2"; filename="x.txt"\r \n Content-Type: text/plain\r \n Content-Length: 4\r \n \r \n bye\n \r \n --xXXxXXyYYzzz\r \n Content-Disposition: form-data; name="attachment_1"; filename="x.txt"\r \n Content-Type: text/plain\r \n Content-Length: 4\r \n \r \n bye\n \r \n --xXXxXXyYYzzz--\r \n '
210212 headers = {
211213 "Content-Length" : "495" ,
@@ -229,7 +231,7 @@ def test_multipart(self):
229231 "accept-encoding" : "identity" ,
230232 "content-length" : "495" ,
231233 "content-type" : "multipart/form-data; boundary=xXXxXXyYYzzz" ,
232- "host" : "httpbin.org " ,
234+ "host" : "httpbin.local " ,
233235 "user-agent" : "Mocket" ,
234236 "connection" : "keep-alive" ,
235237 },
@@ -300,9 +302,11 @@ def test_request_bodies(self):
300302
301303 @mocketize (truesocket_recording_dir = os .path .dirname (__file__ ))
302304 def test_truesendall_with_dump_from_recording (self ):
303- requests .get ("http://httpbin.org/ip" , headers = {"user-agent" : "Fake-User-Agent" })
304305 requests .get (
305- "http://httpbin.org/gzip" , headers = {"user-agent" : "Fake-User-Agent" }
306+ "http://httpbin.local/ip" , headers = {"user-agent" : "Fake-User-Agent" }
307+ )
308+ requests .get (
309+ "http://httpbin.local/gzip" , headers = {"user-agent" : "Fake-User-Agent" }
306310 )
307311
308312 dump_filename = os .path .join (
@@ -311,7 +315,7 @@ def test_truesendall_with_dump_from_recording(self):
311315 with io .open (dump_filename ) as f :
312316 responses = json .load (f )
313317
314- self .assertEqual (len (responses ["httpbin.org " ]["80" ].keys ()), 2 )
318+ self .assertEqual (len (responses ["httpbin.local " ]["80" ].keys ()), 2 )
315319
316320 @mocketize
317321 def test_post_file_object (self ):
0 commit comments