Message81360
| Author |
ajaksu2 |
| Recipients |
ResulCetin, ajaksu2, amaury.forgeotdarc, craigh, dato, jhylton, pitrou, trodgers |
| Date |
2009年02月08日.01:17:55 |
| SpamBayes Score |
0.0020277568 |
| Marked as misclassified |
No |
| Message-id |
<1234055879.82.0.822474620716.issue4631@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Here's a test (in test_urllib2_localnet) that fails before the patch and
passes after, mostly lifted from test_httplib:
def test_chunked(self):
expected_response = b"hello world"
chunked_start = (
b'a\r\n'
b'hello worl\r\n'
b'1\r\n'
b'd\r\n'
)
response = [(200, [("Transfer-Encoding", "chunked")],
chunked_start)]
handler = self.start_server(response)
data = self.urlopen("http://localhost:%s/" % handler.port)
self.assertEquals(data, expected_response)
Output:
test test_urllib2_localnet failed -- Traceback (most recent call last):
File "~/py3k/Lib/test/test_urllib2_localnet.py", line 390, in test_chunked
self.assertEquals(data, expected_response)
AssertionError: b'a\r\nhello worl\r\n1\r\nd\r\n' != b'hello world'
To allow this test to work, the attached patch also touches
FakeHTTPRequestHandler and TestUrlopen.urlopen. |
|