Reflow long lines.
This commit is contained in:
parent
0d52182f67
commit
21d2e59ab1
|
@ -107,19 +107,23 @@ class BasicTest(TestCase):
|
|||
for hp in ("www.python.org:abc", "www.python.org:"):
|
||||
self.assertRaises(httplib.InvalidURL, httplib.HTTP, hp)
|
||||
|
||||
for hp, h, p in (("[fe80::207:e9ff:fe9b]:8000", "fe80::207:e9ff:fe9b", 8000),
|
||||
for hp, h, p in (("[fe80::207:e9ff:fe9b]:8000", "fe80::207:e9ff:fe9b",
|
||||
8000),
|
||||
("www.python.org:80", "www.python.org", 80),
|
||||
("www.python.org", "www.python.org", 80),
|
||||
("[fe80::207:e9ff:fe9b]", "fe80::207:e9ff:fe9b", 80)):
|
||||
http = httplib.HTTP(hp)
|
||||
c = http._conn
|
||||
if h != c.host: self.fail("Host incorrectly parsed: %s != %s" % (h, c.host))
|
||||
if p != c.port: self.fail("Port incorrectly parsed: %s != %s" % (p, c.host))
|
||||
if h != c.host:
|
||||
self.fail("Host incorrectly parsed: %s != %s" % (h, c.host))
|
||||
if p != c.port:
|
||||
self.fail("Port incorrectly parsed: %s != %s" % (p, c.host))
|
||||
|
||||
def test_response_headers(self):
|
||||
# test response with multiple message headers with the same field name.
|
||||
text = ('HTTP/1.1 200 OK\r\n'
|
||||
'Set-Cookie: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"\r\n'
|
||||
'Set-Cookie: Customer="WILE_E_COYOTE";'
|
||||
' Version="1"; Path="/acme"\r\n'
|
||||
'Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1";'
|
||||
' Path="/acme"\r\n'
|
||||
'\r\n'
|
||||
|
@ -187,7 +191,8 @@ class BasicTest(TestCase):
|
|||
resp.close()
|
||||
|
||||
def test_negative_content_length(self):
|
||||
sock = FakeSocket('HTTP/1.1 200 OK\r\nContent-Length: -1\r\n\r\nHello\r\n')
|
||||
sock = FakeSocket('HTTP/1.1 200 OK\r\n'
|
||||
'Content-Length: -1\r\n\r\nHello\r\n')
|
||||
resp = httplib.HTTPResponse(sock, method="GET")
|
||||
resp.begin()
|
||||
self.assertEquals(resp.read(), 'Hello\r\n')
|
||||
|
|
Loading…
Reference in New Issue