summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_smtplib.py
Commit message (Collapse)AuthorAgeFilesLines
* #17498: Defer SMTPServerDisconnected errors until the next command.R David Murray2014-04-141-0/+13
| | | | | | | | | | | | | Normally an SMTP server will return an error, and smtplib will then issue an RSET to return the connection to the known starting state. Some servers, however, disconnect after issuing certain errors. When we issue the RSET, this would result in raising an SMTPServerDisconnected error, *instead* of returning the error code the user of the library was expecting. This fix makes the internal RSET calls ignore the disconnection so that the error code is returned. The user of the library will then get the SMTPServerDisconnected error the next time they try to talk to the server. Patch by Kushal Das.
* merge with 3.3Georg Brandl2014-02-101-1/+29
|
* Issue #20549: Use specific asserts in mailbox, smtplib and poplib tests.Serhiy Storchaka2014-02-081-3/+3
|\
| * Issue #20549: Use specific asserts in mailbox, smtplib and poplib tests.Serhiy Storchaka2014-02-081-3/+3
| |
* | Closes #6683: add a test that exercises multiple authentication.Andrew Kuchling2013-11-111-0/+9
| | | | | | | | | | The SMTP server advertises four different authentication methods, and the code will try CRAM-MD5 first, which will fail, but LOGIN succeeds.
* | merge 3.3 (#19125)Benjamin Peterson2013-09-291-3/+3
|\ \ | |/
| * fix test to run and test that smtpd does support ELHO (closes #19125)Benjamin Peterson2013-09-291-3/+3
| |
* | Merge: #5713: One more test_smtplib timing fix.R David Murray2013-03-211-1/+1
|\ \ | |/
| * #5713: One more test_smtplib timing fix.R David Murray2013-03-211-1/+1
| |
* | Merge: #5712: Preemptively fix some other possible timing issues.R David Murray2013-03-211-3/+3
|\ \ | |/
| * Merge: #5712: Preemptively fix some other possible timing issues.R David Murray2013-03-211-3/+3
| |\
| | * #5712: Preemptively fix some other possible timing issues.R David Murray2013-03-211-3/+3
| | |
* | | Merge: #5713: fix timing issue in smtplib tests.R David Murray2013-03-211-0/+3
|\ \ \ | |/ /
| * | Merge: #5713: fix timing issue in smtplib tests.R David Murray2013-03-211-0/+3
| |\ \ | | |/
| | * #5713: fix timing issue in smtplib tests.R David Murray2013-03-211-0/+3
| | |
* | | Merge: #5713: Handle 421 error codes during sendmail by closing the socket.R David Murray2013-03-211-9/+65
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | This is a partial fix to the issue of servers disconnecting unexpectedly; in this case the 421 says they are disconnecting, so we close the socket and return the 421 in the appropriate error context. Original patch by Mark Sapiro, updated by Kushal Das, with additional tests by me.
| * | Merge: #5713: Handle 421 error codes during sendmail by closing the socket.R David Murray2013-03-211-9/+65
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | This is a partial fix to the issue of servers disconnecting unexpectedly; in this case the 421 says they are disconnecting, so we close the socket and return the 421 in the appropriate error context. Original patch by Mark Sapiro, updated by Kushal Das, with additional tests by me.
| | * #5713: Handle 421 error codes during sendmail by closing the socket.R David Murray2013-03-211-1/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a partial fix to the issue of servers disconnecting unexpectedly; in this case the 421 says they are disconnecting, so we close the socket and return the 421 in the appropriate error context. Original patch by Mark Sapiro, updated by Kushal Das, with additional tests by me.
* | | Replace IOError with OSError (#16715)Andrew Svetlov2012-12-251-1/+1
| | |
* | | Issue #16717: get rid of socket.error, replace with OSErrorAndrew Svetlov2012-12-181-1/+1
| | |
* | | Cleanup: remove not needed mocks.Andrew Svetlov2012-12-171-6/+0
| | |
* | | Issue #16647: save socket error details in LMTP.connect()Andrew Svetlov2012-12-171-2/+2
|/ / | | | | | | Initial patch by Serhiy Storchaka.
* | #8739: upgrade smtpd to RFC 5321 and 1870.R David Murray2012-05-261-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | smtpd now handles EHLO and has infrastructure for extended smtp command mode. The SIZE extension is also implemented. In order to support parameters on MAIL FROM, the RFC 5322 parser from the email package is used to parse the address "token". Logging subclasses things and overrides __init__, so it was necessary to update those __init__ functions in the logging tests to make the logging tests pass. The original suggestion and patch were by Alberto Trevino. Juhana Jauhiainen added the --size argument and SIZE parameter support. Michele Orrù improved the patch and added more tests. Dan Boswell conditionalized various bits of code on whether or not we are in HELO or EHLO mode, as well as some other improvements and tests. I finalized the patch and added the address parsing.
* | Issue #14442: Add missing errno import in test_smtplib.Ross Lagerwall2012-03-291-0/+1
| |
* | Make tests faster by reaping threads only at the endAntoine Pitrou2011-08-271-4/+1
|\ \ | |/
| * Make tests faster by reaping threads only at the endAntoine Pitrou2011-08-271-4/+1
| |
* | Addressing the review comments by Antoine Pitrou for smtplib.py and ↵Senthil Kumaran2011-07-311-6/+11
| | | | | | | | test_smtplib.py. Review comments by Ezio Melotti for smtplib.rst
* | Fix closes Issue11281 - smtplib.STMP gets source_address parameter, which ↵Senthil Kumaran2011-07-301-0/+17
| | | | | | | | adds the ability to bind to specific source address on a machine with multiple interfaces. Patch by Paulo Scardine.
* | Merge #7484: no more <> around addresses in VRFY or EXPNR David Murray2011-07-191-9/+24
|\ \ | |/
| * #7484: no more <> around addresses in VRFY or EXPNR David Murray2011-07-191-9/+24
| | | | | | | | | | | | | | | | | | The RFC doesn't say that they are allowed; apparently many mailers accept them, but not postfix. Contributions to this patch were made by Felipe Cruz and Catalin Iacob. The changeset also adds additional indirect tests for quoteaddr (null address and IDNA-encoded address).
* | merge #12147: make send_message correctly handle Sender and Resent- headers.R David Murray2011-07-031-1/+110
|\ \ | |/
| * #12147: make send_message correctly handle Sender and Resent- headers.R David Murray2011-07-031-1/+110
| | | | | | | | | | Original patch by Nicolas Estibals. My tweaks to the patch were mostly style/cosmetic, and adding more tests.
* | merge #12283: Fixed regression in smtplib quoting of leading dots in DATA.R David Murray2011-06-091-0/+15
|\ \ | |/
| * #12283: Fixed regression in smtplib quoting of leading dots in DATA.R David Murray2011-06-091-0/+15
| | | | | | | | | | | | I unfortunately introduced the regression when I refactored the code, and there were no tests of quoting so it wasn't caught. Now there is one.
* | Merge: I was right, hardconding the localhost IP doesn't work in linux-vserver.R David Murray2011-05-021-6/+3
|\ \ | |/
| * I was right, hardconding the localhost IP doesn't work in linux-vserver.R David Murray2011-05-021-6/+3
| |
* | - Issue #11289: `smtp.SMTP` class becomes a context manager so it can be usedBarry Warsaw2011-03-151-2/+36
|/ | | | in a `with` statement. Contributed by Giampaolo Rodola.
* #10273: Rename assertRegexpMatches and assertRaisesRegexp to assertRegex and ↵Ezio Melotti2010-12-011-4/+4
| | | | assertRaisesRegex.
* #10321: Add support for sending binary DATA and Message objects to smtplibR. David Murray2010-11-081-0/+106
|
* string exceptions; how quaintBenjamin Peterson2010-10-311-4/+2
|
* cleanup resources in test_smtplib #10264Benjamin Peterson2010-10-311-0/+3
|
* Fix issue 6706: adds new handle_accepted() method to asyncore.dispatcherGiampaolo Rodolà2010-10-041-2/+1
|
* fix test_smtplib/test_smtpd collision through pre-loaded reply data in ↵Richard Jones2010-08-041-0/+5
| | | | mock_socket
* improvements to test_smtplib per issue2423Richard Jones2010-08-031-34/+27
| | | | merged the socket mock introduced in test_smtpd
* Merged revisions 80882 via svnmerge fromGiampaolo Rodolà2010-05-061-0/+6
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r80882 | giampaolo.rodola | 2010-05-06 22:19:32 +0200 (gio, 06 mag 2010) | 1 line adds handle_error(self):raise to test modules using asyncore to provide a clearer error message in case something goes wrong ........
* Merged revisions 80669 via svnmerge fromAntoine Pitrou2010-04-301-4/+8
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r80669 | antoine.pitrou | 2010-05-01 01:08:48 +0200 (sam., 01 mai 2010) | 4 lines Issue #8576: Remove use of find_unused_port() in test_smtplib and test_multiprocessing. Patch by Paul Moore. ........
* Merged revisions 80552-80556,80564-80566,80568-80571 via svnmerge fromVictor Stinner2010-04-281-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r80552 | victor.stinner | 2010-04-27 23:46:03 +0200 (mar., 27 avril 2010) | 3 lines Issue #7449, part 1: fix test_support.py for Python compiled without thread ........ r80553 | victor.stinner | 2010-04-27 23:47:01 +0200 (mar., 27 avril 2010) | 1 line Issue #7449, part 2: regrtest.py -j option requires thread support ........ r80554 | victor.stinner | 2010-04-27 23:51:26 +0200 (mar., 27 avril 2010) | 9 lines Issue #7449 part 3, test_doctest: import trace module in test_coverage() Import trace module fail if the threading module is missing. test_coverage() is only used if test_doctest.py is used with the -c option. This commit allows to execute the test suite without thread support. Move "import trace" in test_coverage() and use test_support.import_module('trace'). ........ r80555 | victor.stinner | 2010-04-27 23:56:26 +0200 (mar., 27 avril 2010) | 6 lines Issue #7449, part 4: skip test_multiprocessing if thread support is disabled import threading after _multiprocessing to raise a more revelant error message: "No module named _multiprocessing". _multiprocessing is not compiled without thread support. ........ r80556 | victor.stinner | 2010-04-28 00:01:24 +0200 (mer., 28 avril 2010) | 8 lines Issue #7449, part 5: split Test.test_open() of ctypes/test/test_errno.py * Split Test.test_open() in 2 functions: test_open() and test_thread_open() * Skip test_open() and test_thread_open() if we are unable to find the C library * Skip test_thread_open() if thread support is disabled * Use unittest.skipUnless(os.name == "nt", ...) on test_GetLastError() ........ r80564 | victor.stinner | 2010-04-28 00:59:35 +0200 (mer., 28 avril 2010) | 4 lines Issue #7449, part 6: fix test_hashlib for missing threading module Move @test_support.reap_thread decorator from test_main() to test_threaded_hashing(). ........ r80565 | victor.stinner | 2010-04-28 01:01:29 +0200 (mer., 28 avril 2010) | 6 lines Issue #7449, part 7: simplify threading detection in test_capi * Skip TestPendingCalls if threading module is missing * Test if threading module is present or not, instead of test the presence of _testcapi._test_thread_state ........ r80566 | victor.stinner | 2010-04-28 01:03:16 +0200 (mer., 28 avril 2010) | 4 lines Issue #7449, part 8: don't skip the whole test_asynchat if threading is missing TestFifo can be executed without the threading module ........ r80568 | victor.stinner | 2010-04-28 01:14:58 +0200 (mer., 28 avril 2010) | 6 lines Issue #7449, part 9: fix test_xmlrpclib for missing threading module * Skip testcases using threads if threading module is missing * Use "http://" instead of URL in ServerProxyTestCase if threading is missing because URL is not set in this case ........ r80569 | victor.stinner | 2010-04-28 01:33:58 +0200 (mer., 28 avril 2010) | 6 lines Partial revert of r80556 (Issue #7449, part 5, fix ctypes test) Rewrite r80556: the thread test have to be executed just after the test on libc_open() and so the test cannot be splitted in two functions (without duplicating code, and I don't want to duplicate code). ........ r80570 | victor.stinner | 2010-04-28 01:51:16 +0200 (mer., 28 avril 2010) | 8 lines Issue #7449, part 10: test_cmd imports trace module using test_support.import_module() Use test_support.import_module() instead of import to raise a SkipTest exception if the import fail. Import trace fails if the threading module is missing. See also part 3: test_doctest: import trace module in test_coverage(). ........ r80571 | victor.stinner | 2010-04-28 01:55:59 +0200 (mer., 28 avril 2010) | 6 lines Issue #7449, last part (11): fix many tests if thread support is disabled * Use try/except ImportError or test_support.import_module() to import thread and threading modules * Add @unittest.skipUnless(threading, ...) to testcases using threads ........
* Merged revisions 75849 via svnmerge fromAntoine Pitrou2009-10-271-4/+20
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r75849 | antoine.pitrou | 2009-10-27 20:47:30 +0100 (mar., 27 oct. 2009) | 3 lines Suppress transient refleaks in test_smtplib. ........
* Merged revisions 73022 via svnmerge fromR. David Murray2009-05-291-14/+13
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r73022 | r.david.murray | 2009-05-29 13:31:05 -0400 (Fri, 29 May 2009) | 2 lines Refactor test parameterization to resolve update timing problem. ........
* Finish issue 5259 by adding tests and fixes for the 'login'R. David Murray2009-05-281-22/+75
| | | | and 'cram-md5' auth methods.