summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_smtplib.py
Commit message (Collapse)AuthorAgeFilesLines
* Try to reduce the flakiness of this testNeal Norwitz2008-08-251-0/+4
|
* give the threading API PEP 8 namesBenjamin Peterson2008-06-111-2/+2
|
* Fixed the semantic of timeout for socket.create_connection andFacundo Batista2008-05-291-16/+18
| | | | | | all the upper level libraries that use it, including urllib2. Added and fixed some tests, and changed docs correspondingly. Thanks to John J Lee for the patch and the pusing, :)
* - Issue #2550: The approach used by client/server code for obtaining portsTrent Nelson2008-04-081-41/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Try increasing the timeout to reduce the flakiness of this test.Neal Norwitz2008-03-181-4/+4
|
* Make the timeout longer to give slow machines a chance to pass the testNeal Norwitz2008-03-051-1/+1
| | | | | | before timing out. This doesn't change the duration of the test under normal circumstances. This is targetted at fixing the spurious failures on the FreeBSD buildbot primarily.
* Speed up this test by about 99%. Remove sleeps and replace with events.Neal Norwitz2008-02-261-65/+42
| | | | | | | | (This may fail on some slow platforms, but we can fix those cases which should be relatively isolated and easier to find now.) Move two test cases that didn't require a server to be started to a separate TestCase. These tests were taking 3 seconds which is what the timeout was set to.
* Issue 1776581. Minor corrections to smtplib, and two small tests.Facundo Batista2008-02-231-2/+3
| | | | Thanks Alan McIntyre.
* Added test for behavior of operations on an unconnected SMTP object,Facundo Batista2007-08-211-11/+192
| | | | | | | | and tests for NOOP, RSET, and VRFY. Corrected typo in a comment for testNonnumericPort. Added a check for constructing SMTP objects when non-numeric ports are included in the host name. Derived a server from SMTPServer to test various ESMTP/SMTP capabilities. Check that a second HELO to DebuggingServer returns an error. [GSoC - Alan McIntyre]
* Allow the OS to select a free port for each test server. ForFacundo Batista2007-08-011-30/+99
| | | | | | | | | DebuggingServerTests, construct SMTP objects with a localhost argument to avoid abysmally long FQDN lookups (not relevant to items under test) on some machines that would cause the test to fail. Moved server setup code in the server function inside the try block to avoid the possibility of setup failure hanging the test. Minor edits to conform to PEP 8. [GSoC - Alan McIntyre]
* New tests for basic behavior of smtplib.SMTP andFacundo Batista2007-07-241-10/+121
| | | | | | | smtpd.DebuggingServer. Change to use global host & port number variables. Modified the 'server' to take a string to send back in order to vary test server responses. Added a test for the reaction of smtplib.SMTP to a non-200 HELO response. [GSoC - Alan McIntyre]
* Whitespace normalization. Ugh, we really need to do this more often.Neal Norwitz2007-04-251-3/+3
| | | | You might want to review this change as it's my first time. Be gentle. :-)
* Added timeout to smtplib (to SMTP and SMTP_SSL). Also createdFacundo Batista2007-03-281-0/+71
the test_smtplib.py file, with a basic test and the timeout ones. Docs are updated too.