diff -r c6237edff631 Lib/test/test_smtplib.py --- a/Lib/test/test_smtplib.py Sat Nov 03 18:29:31 2012 +0200 +++ b/Lib/test/test_smtplib.py Sat Nov 03 14:43:44 2012 -0400 @@ -799,6 +799,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()