Author ajaksu2
Recipients ResulCetin, ajaksu2, amaury.forgeotdarc, craigh, dato, jhylton, pitrou, trodgers
Date 2009-02-08.01:17:55
SpamBayes Score 0.00202776
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.
History
Date User Action Args
2009-02-08 01:18:00ajaksu2setrecipients: + ajaksu2, jhylton, amaury.forgeotdarc, pitrou, craigh, dato, ResulCetin, trodgers
2009-02-08 01:17:59ajaksu2setmessageid: <1234055879.82.0.822474620716.issue4631@psf.upfronthosting.co.za>
2009-02-08 01:17:58ajaksu2linkissue4631 messages
2009-02-08 01:17:57ajaksu2create