mirror of
https://github.com/python/cpython.git
synced 2025-08-14 13:59:20 +00:00
Merged revisions 67398,67423-67424,67432,67440-67441,67444-67445,67454,67457,67463 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r67398 | benjamin.peterson | 2008-11-26 18:39:17 +0100 (Wed, 26 Nov 2008) | 1 line fix typo in sqlite3 docs ........ r67423 | jesse.noller | 2008-11-28 19:59:35 +0100 (Fri, 28 Nov 2008) | 2 lines issue4238: bsd support for cpu_count ........ r67424 | christian.heimes | 2008-11-28 20:33:33 +0100 (Fri, 28 Nov 2008) | 1 line Retain copyright of processing examples. This was requested by a Debian maintainer during packaging of the multiprocessing package for 2.4/2.5 ........ r67432 | benjamin.peterson | 2008-11-29 00:18:46 +0100 (Sat, 29 Nov 2008) | 1 line SVN format 9 is the same it seems ........ r67440 | jeremy.hylton | 2008-11-29 00:42:59 +0100 (Sat, 29 Nov 2008) | 4 lines Move definition int sval into branch of ifdef where it is used. Otherwise, you get a warning about an undefined variable. ........ r67441 | jeremy.hylton | 2008-11-29 01:09:16 +0100 (Sat, 29 Nov 2008) | 2 lines Reflow long lines. ........ r67444 | amaury.forgeotdarc | 2008-11-29 03:03:32 +0100 (Sat, 29 Nov 2008) | 2 lines Fix a small typo in docstring ........ r67445 | benjamin.peterson | 2008-11-30 04:07:33 +0100 (Sun, 30 Nov 2008) | 1 line StringIO.close() stops you from using the buffer, too ........ r67454 | benjamin.peterson | 2008-11-30 15:43:23 +0100 (Sun, 30 Nov 2008) | 1 line note the version that works ........ r67457 | christian.heimes | 2008-11-30 22:16:28 +0100 (Sun, 30 Nov 2008) | 1 line w# requires Py_ssize_t ........ r67463 | skip.montanaro | 2008-12-01 02:55:22 +0100 (Mon, 01 Dec 2008) | 1 line typo in comment ........
This commit is contained in:
parent
f917e86b89
commit
5c7f8fb7fd
15 changed files with 43 additions and 16 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue