mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Fixed formatting error in python2.6
This commit is contained in:
+4
-4
@@ -164,7 +164,7 @@ class TestContentEncodingDetection:
|
||||
data = (i for i in [b'a', b'b', b'c'])
|
||||
|
||||
with server as (host, port):
|
||||
url = 'http://{}:{}/'.format(host, port)
|
||||
url = 'http://{0}:{1}/'.format(host, port)
|
||||
r = requests.post(url, data=data, stream=True)
|
||||
block_server.set() # release server block
|
||||
|
||||
@@ -288,7 +288,7 @@ class TestTestServer:
|
||||
)
|
||||
|
||||
with server as (host, port):
|
||||
r = requests.get('http://{}:{}'.format(host, port))
|
||||
r = requests.get('http://{0}:{1}'.format(host, port))
|
||||
|
||||
assert r.status_code == 200
|
||||
assert r.text == 'roflol'
|
||||
@@ -296,7 +296,7 @@ class TestTestServer:
|
||||
|
||||
def test_basic_response(self):
|
||||
with Server.basic_response_server() as (host, port):
|
||||
r = requests.get('http://{}:{}'.format(host, port))
|
||||
r = requests.get('http://{0}:{1}'.format(host, port))
|
||||
assert r.status_code == 200
|
||||
assert r.text == ''
|
||||
assert r.headers['Content-Length'] == '0'
|
||||
@@ -318,7 +318,7 @@ class TestTestServer:
|
||||
server = Server.basic_response_server(requests_to_handle=requests_to_handle)
|
||||
|
||||
with server as (host, port):
|
||||
server_url = 'http://{}:{}'.format(host, port)
|
||||
server_url = 'http://{0}:{1}'.format(host, port)
|
||||
for _ in range(requests_to_handle):
|
||||
r = requests.get(server_url)
|
||||
assert r.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user