summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_imaplib.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-11-12 18:49:16 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-11-12 18:49:16 (GMT)
commitf3b001f966d8e16662241e2ed7c7f345cd7051db (patch)
treed1f3d82d1a743763eda10f2b820783d966c1de21 /Lib/test/test_imaplib.py
parente0bf419ae7586b8e40b16eaec63122e71023e4fa (diff)
downloadcpython-f3b001f966d8e16662241e2ed7c7f345cd7051db.zip
cpython-f3b001f966d8e16662241e2ed7c7f345cd7051db.tar.gz
cpython-f3b001f966d8e16662241e2ed7c7f345cd7051db.tar.bz2
Issue #4471: Add the IMAP.starttls() method to enable encryption on
standard IMAP4 connections. Original patch by Lorenzo M. Catucci.
Diffstat (limited to 'Lib/test/test_imaplib.py')
-rw-r--r--Lib/test/test_imaplib.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py
index 351659d..9bae65a 100644
--- a/Lib/test/test_imaplib.py
+++ b/Lib/test/test_imaplib.py
@@ -209,8 +209,6 @@ class RemoteIMAPTest(unittest.TestCase):
def test_logincapa(self):
self.assertTrue('LOGINDISABLED' in self.server.capabilities)
-
- def test_anonlogin(self):
self.assertTrue('AUTH=ANONYMOUS' in self.server.capabilities)
rs = self.server.login(self.username, self.password)
self.assertEqual(rs[0], 'OK')
@@ -222,6 +220,18 @@ class RemoteIMAPTest(unittest.TestCase):
@unittest.skipUnless(ssl, "SSL not available")
+class RemoteIMAP_STARTTLSTest(RemoteIMAPTest):
+
+ def setUp(self):
+ super().setUp()
+ rs = self.server.starttls()
+ self.assertEqual(rs[0], 'OK')
+
+ def test_logincapa(self):
+ self.assertFalse('LOGINDISABLED' in self.server.capabilities)
+
+
+@unittest.skipUnless(ssl, "SSL not available")
class RemoteIMAP_SSLTest(RemoteIMAPTest):
port = 993
imap_class = IMAP4_SSL
@@ -243,7 +253,7 @@ def test_main():
raise support.TestFailed("Can't read certificate files!")
tests.extend([
ThreadedNetworkedTests, ThreadedNetworkedTestsSSL,
- RemoteIMAPTest, RemoteIMAP_SSLTest,
+ RemoteIMAPTest, RemoteIMAP_SSLTest, RemoteIMAP_STARTTLSTest,
])
support.run_unittest(*tests)