|
12 | 12 | import calendar
|
13 | 13 |
|
14 | 14 | from test.support import (reap_threads, verbose, transient_internet,
|
15 |
| - run_with_tz, run_with_locale) |
| 15 | + run_with_tz, run_with_locale, cpython_only) |
16 | 16 | import unittest
|
17 | 17 | from unittest import mock
|
18 | 18 | from datetime import datetime, timezone, timedelta
|
@@ -503,6 +503,15 @@ def test_ssl_verified(self):
|
503 | 503 | ssl_context=ssl_context)
|
504 | 504 | client.shutdown()
|
505 | 505 |
|
| 506 | + # Mock the private method _connect(), so mark the test as specific |
| 507 | + # to CPython stdlib |
| 508 | + @cpython_only |
| 509 | + def test_certfile_arg_warn(self): |
| 510 | + with support.check_warnings(('', DeprecationWarning)): |
| 511 | + with mock.patch.object(self.imap_class, 'open'): |
| 512 | + with mock.patch.object(self.imap_class, '_connect'): |
| 513 | + self.imap_class('localhost', 143, certfile=CERTFILE) |
| 514 | + |
506 | 515 | class ThreadedNetworkedTests(unittest.TestCase):
|
507 | 516 | server_class = socketserver.TCPServer
|
508 | 517 | imap_class = imaplib.IMAP4
|
@@ -965,25 +974,6 @@ def test_logincapa(self):
|
965 | 974 | _server = self.imap_class(self.host, self.port)
|
966 | 975 | self.check_logincapa(_server)
|
967 | 976 |
|
968 |
| - @unittest.skipIf(True, |
969 |
| - "bpo-30175: FIXME: cyrus.andrew.cmu.edu doesn't accept " |
970 |
| - "our randomly generated client x509 certificate anymore") |
971 |
| - def test_logincapa_with_client_certfile(self): |
972 |
| - with transient_internet(self.host): |
973 |
| - with support.check_warnings(('', DeprecationWarning)): |
974 |
| - _server = self.imap_class(self.host, self.port, |
975 |
| - certfile=CERTFILE) |
976 |
| - self.check_logincapa(_server) |
977 |
| - |
978 |
| - @unittest.skipIf(True, |
979 |
| - "bpo-30175: FIXME: cyrus.andrew.cmu.edu doesn't accept " |
980 |
| - "our randomly generated client x509 certificate anymore") |
981 |
| - def test_logincapa_with_client_ssl_context(self): |
982 |
| - with transient_internet(self.host): |
983 |
| - _server = self.imap_class( |
984 |
| - self.host, self.port, ssl_context=self.create_ssl_context()) |
985 |
| - self.check_logincapa(_server) |
986 |
| - |
987 | 977 | def test_logout(self):
|
988 | 978 | with transient_internet(self.host):
|
989 | 979 | _server = self.imap_class(self.host, self.port)
|
|
0 commit comments