summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httplib.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo with regards to self.PORT shadowing class variables with the same name.Trent Nelson2008-04-091-4/+5
|
* - Issue #2550: The approach used by client/server code for obtaining portsTrent Nelson2008-04-081-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to listen on in network-oriented tests has been refined in an effort to facilitate running multiple instances of the entire regression test suite in parallel without issue. test_support.bind_port() has been fixed such that it will always return a unique port -- which wasn't always the case with the previous implementation, especially if socket options had been set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT). The new implementation of bind_port() will actually raise an exception if it is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or SO_REUSEPORT socket option set. Furthermore, if available, bind_port() will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed. This currently only applies to Windows. This option prevents any other sockets from binding to the host/port we've bound to, thus removing the possibility of the 'non-deterministic' behaviour, as Microsoft puts it, that occurs when a second SOCK_STREAM socket binds and accepts to a host/port that's already been bound by another socket. The optional preferred port parameter to bind_port() has been removed. Under no circumstances should tests be hard coding ports! test_support.find_unused_port() has also been introduced, which will pass a temporary socket object to bind_port() in order to obtain an unused port. The temporary socket object is then closed and deleted, and the port is returned. This method should only be used for obtaining an unused port in order to pass to an external program (i.e. the -accept [port] argument to openssl's s_server mode) or as a parameter to a server-oriented class that doesn't give you direct access to the underlying socket used. Finally, test_support.HOST has been introduced, which should be used for the host argument of any relevant socket calls (i.e. bind and connect). The following tests were updated to following the new conventions: test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib, test_poplib, test_ftplib, test_telnetlib, test_socketserver, test_asynchat and test_socket_ssl. It is now possible for multiple instances of the regression test suite to run in parallel without issue.
* #1627: httplib now ignores negative Content-Length headers.Georg Brandl2008-02-241-0/+7
|
* #900744: If an invalid chunked-encoding header is sent by a server,Georg Brandl2008-02-241-0/+29
| | | | | httplib will now raise IncompleteRead and close the connection instead of raising ValueError.
* Patch #2167 from calvin: Remove unused importsChristian Heimes2008-02-231-1/+0
|
* Issue #1580738. When HTTPConnection reads the whole stream with read(),Facundo Batista2007-10-181-2/+13
| | | | | | | it closes itself. When the stream is read in several calls to read(n), it should behave in the same way if HTTPConnection knows where the end of the stream is (through self.length). Added a test case for this behaviour.
* One more fix to consider missing SSL support.Thomas Wouters2007-08-301-2/+3
|
* Added timeout support to HTTPSConnection, through theFacundo Batista2007-05-211-1/+9
| | | | | socket.create_connection function. Also added a small test for this, and updated NEWS file.
* Whitespace normalization. Ugh, we really need to do this more often.Neal Norwitz2007-04-251-2/+2
| | | | You might want to review this change as it's my first time. Be gentle. :-)
* Closing the HTTP connection after each test, and listening more.Facundo Batista2007-03-251-1/+4
|
* Surrounded with try/finally to socket's default timeout settingFacundo Batista2007-03-231-7/+9
| | | | | | changes in the tests, so failing one test won't produce strange results in others. Also relaxed the timeout settings in the test (where actually the value didn't mean anything).
* Added a 'create_connect()' function to socket.py, which creates aFacundo Batista2007-03-231-1/+41
| | | | | connection with an optional timeout, and modified httplib.py to use this function in HTTPConnection. Applies patch 1676823.
* Patch #1065257: Support passing open files as body inMartin v. Löwis2006-11-121-1/+12
| | | | HTTPConnection.request().
* Completely convert test_httplib to unittest.Georg Brandl2006-10-291-90/+63
|
* Move test case for HTTP response dict to httplib.Georg Brandl2006-02-171-1/+5
|
* Whitespace normalization.Tim Peters2004-09-161-1/+1
|
* Remove tabs.Brett Cannon2004-09-151-4/+4
|
* Strip square brackets from IPv6 address.Martin v. Löwis2004-09-141-3/+8
|
* missed the obvious test case and corresponding fixSkip Montanaro2004-09-141-1/+1
|
* Search from the end of the host/port combination to find the colon whichSkip Montanaro2004-09-141-0/+7
| | | | separates ip address from the port to accommodate ipv6 addresses.
* SF bug 874842 and patch 997626: httplib bugsJeremy Hylton2004-08-071-1/+44
| | | | | | Hack httplib to work with broken Akamai proxies. Make sure that httplib doesn't add extract Accept-Encoding or Content-Length headers if the client has already set them.
* Fix SF bug 764095: Don't use network in test_httplib.Jeremy Hylton2003-07-081-14/+33
|
* SF bug 622042: Don't expect response body from HEAD request.Jeremy Hylton2003-05-051-0/+13
| | | | Bug fix candidate.
* Fix for SF bug 661340: test_httplib fails on the mac.Jeremy Hylton2003-01-231-41/+64
| | | | The test no longer produces output with \r\n in it.
* Complete the absolute import patch for the test suite. All relativeBarry Warsaw2002-07-301-1/+1
| | | | | | | | imports of test modules now import from the test package. Other related oddities are also fixed (like DeprecationWarning filters that weren't specifying the full import part, etc.). Also did a general code cleanup to remove all "from test.test_support import *"'s. Other from...import *'s weren't changed.
* Whitespace normalization.Tim Peters2002-07-161-1/+0
|
* Change _begin() back to begin().Jeremy Hylton2002-07-121-3/+3
| | | | Client code could create responses explicitly.
* Fix for SF bug #432621: httplib: multiple Set-Cookie headersJeremy Hylton2002-07-071-2/+20
| | | | | | | | | | If multiple header fields with the same name occur, they are combined according to the rules in RFC 2616 sec 4.2: Appending each subsequent field-value to the first, each separated by a comma. The order in which header fields with the same field-name are received is significant to the interpretation of the combined field value.
* Track change of begin() to _begin().Jeremy Hylton2002-06-281-2/+2
|
* Use attributes appropriatelyNeal Norwitz2002-04-011-1/+1
|
* add test of InvalidURLSkip Montanaro2002-03-241-0/+10
|
* test_support should be imported directly, not via test.test_support.Tim Peters2001-09-251-1/+1
|
* Add test for SF bug #405427Jeremy Hylton2001-04-131-0/+31