MCPcopy Index your code
hub / github.com/python/cpython / testAUTH_BUGGY

Method testAUTH_BUGGY

Lib/test/test_smtplib.py:1159–1177  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1157 self.assertEqual(resp, (235, b'Authentication Succeeded'))
1158
1159 def testAUTH_BUGGY(self):
1160 self.serv.add_feature("AUTH BUGGY")
1161
1162 def auth_buggy(challenge=None):
1163 self.assertEqual(b"BuGgYbUgGy", challenge)
1164 return "\0"
1165
1166 smtp = smtplib.SMTP(
1167 HOST, self.port, local_hostname='localhost',
1168 timeout=support.LOOPBACK_TIMEOUT
1169 )
1170 try:
1171 smtp.user, smtp.password = sim_auth
1172 smtp.ehlo("test_auth_buggy")
1173 expect = r"^Server AUTH mechanism infinite loop.*"
1174 with self.assertRaisesRegex(smtplib.SMTPException, expect) as cm:
1175 smtp.auth("BUGGY", auth_buggy, initial_response_ok=False)
1176 finally:
1177 smtp.close()
1178
1179 @hashlib_helper.requires_hashdigest('md5', openssl=True)
1180 def testAUTH_CRAM_MD5(self):

Callers

nothing calls this directly

Calls 5

ehloMethod · 0.95
authMethod · 0.95
closeMethod · 0.95
add_featureMethod · 0.80
assertRaisesRegexMethod · 0.80

Tested by

no test coverage detected