summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix urllib2.urlopen() handling of chunked content encoding.Jeremy Hylton2004-08-071-0/+2
| | | | | | | | | | | | | | | | | The change to use the newer httplib interface admitted the possibility that we'd get an HTTP/1.1 chunked response, but the code didn't handle it correctly. The raw socket object can't be pass to addinfourl(), because it would read the undecoded response. Instead, addinfourl() must call HTTPResponse.read(), which will handle the decoding. One extra wrinkle is that the HTTPReponse object can't be passed to addinfourl() either, because it doesn't implement readline() or readlines(). As a quick hack, use socket._fileobject(), which implements those methods on top of a read buffer. (suggested by mwh) Finally, add some tests based on test_urllibnet. Thanks to Andrew Sawyers for originally reporting the chunked problem.
* Patch [ 972332 ] urllib2 FTPHandler bugs / John J. LeeKurt B. Kaiser2004-07-111-10/+7
| | | | | Modified Files: urllib2.py test/test_urllib2.py
* [Patch #988602] Move the urllib2 tests into the test frameworkAndrew M. Kuchling2004-07-101-1/+129
|
* Whitespace normalization.Tim Peters2004-07-081-1/+1
|
* Remove unused import. (If it's there for some deep, dark reason, it should ↵Andrew M. Kuchling2004-06-291-1/+0
| | | | have been commented.)
* Add test case for bug #912845: requesting an HTTP byte range doesn't workAndrew M. Kuchling2004-06-291-6/+16
|
* Patch #963318: Add support for client-side cookie management.Martin v. Löwis2004-05-311-23/+76
|
* Fix two bugs in the new do_open() implementation for HTTPHandler.Jeremy Hylton2004-02-241-1/+2
| | | | | | | | | Invoke the standard error handlers for non-200 responses. Always supply a "Connection: close" header to prevent the server from leaving the connection open. Downstream users of the socket may attempt recv()/read() with no arguments, which would block if the connection were kept open.
* Whitespace normalization.Tim Peters2004-01-181-19/+21
|
* Remove methods that are no longer called by urllib2.Jeremy Hylton2003-12-171-14/+0
|
* Add methods to MockHTTPClass for modern httplib interface.Jeremy Hylton2003-12-171-51/+77
| | | | Replace lots of assert_(x == y) with assertEqual(x, y).
* SF patch 852995: add processors feature to urllib2Jeremy Hylton2003-12-141-29/+614
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | John J. Lee writes: "the patch makes it possible to implement functionality like HTTP cookie handling, Refresh handling, etc. etc. using handler objects. At the moment urllib2's handler objects aren't quite up to the job, which results in a lot of cut-n-paste and subclassing. I believe the changes are backwards-compatible, with the exception of people who've reimplemented build_opener()'s functionality -- those people would need to call opener.add_handler(HTTPErrorProcessor). The main change is allowing handlers to implement methods like: http_request(request) http_response(request, response) In addition to the usual http_open(request) http_error{_*}(...) " Note that the change isn't well documented at least in part because handlers aren't well documented at all. Need to fix this. Add a bunch of new tests. It appears that none of these tests actually use the network, so they don't need to be guarded by a resource flag.
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* SF patch #474590 -- RISC OS supportGuido van Rossum2001-10-241-0/+5
|
* Whitespace normalization.Tim Peters2001-09-041-1/+1
|
* A quick hack to make the test pass on the Mac (similar to the quick hackJack Jansen2001-08-271-0/+4
| | | | to make it pass on Windows:-).
* This has never worked on Windows. Now it does. If it breaks on Unix now,Tim Peters2001-07-161-1/+7
| | | | great, it's your turn to watch it fail for months <0.9 wink>.
* Whitespace normalization.Tim Peters2001-05-291-1/+0
|
* Trivial tests of urllib2 for recent SF bugJeremy Hylton2001-05-091-0/+17