[Python-checkins] cpython: Closes #6683: add a test that exercises multiple authentication.
andrew.kuchling
python-checkins at python.org
Mon Nov 11 20:03:54 CET 2013
http://hg.python.org/cpython/rev/19912ad231a3
changeset: 87054:19912ad231a3
user: Andrew Kuchling <amk at amk.ca>
date: Mon Nov 11 14:03:23 2013 -0500
summary:
Closes #6683: add a test that exercises multiple authentication.
The SMTP server advertises four different authentication methods, and
the code will try CRAM-MD5 first, which will fail, but LOGIN succeeds.
files:
Lib/test/test_smtplib.py | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -819,6 +819,15 @@
self.assertIn(sim_auth_credentials['cram-md5'], str(err))
smtp.close()
+ def testAUTH_multiple(self):
+ # Test that multiple authentication methods are tried.
+ self.serv.add_feature("AUTH BOGUS PLAIN LOGIN CRAM-MD5")
+ smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
+ try: smtp.login(sim_auth[0], sim_auth[1])
+ except smtplib.SMTPAuthenticationError as err:
+ self.assertIn(sim_auth_login_password, str(err))
+ smtp.close()
+
def test_with_statement(self):
with smtplib.SMTP(HOST, self.port) as smtp:
code, message = smtp.noop()
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list