# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode',
+ 'sphinx.ext.intersphinx']
+
+intersphinx_mapping = {'python':('http://docs.python.org/3', None)}
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
``False``). This is useful for exotic connection or authentication
setups.
+ Additional keyword arguments are passed to the constructor of the
+ :py:class:`imaplib.IMAP4` class, resp. :py:class:`imaplib.IMAP4_SSL` when
+ *ssl* is ``True``, which is used by ``IMAPClient`` internally. This allows
+ passing SSL related parameters, i.e. *keyfile* and *certfile* or an
+ :py:class:`ssl.SSLContext` instance with *ssl_context*. Please note that
+ some keyword arguments of the :py:class:`imaplib.IMP4_SSL` init method are
+ only supported in newer Python versions, in particular, the *ssl_context*
+ argument was added in Python 3.3. The class :py:class:`imaplib.IMAP4` (no
+ SSL) does not accept any additional keyword arguments. For details, see the
+ :py:mod:`imaplib` documentation in the standard library reference.
+
The *normalise_times* attribute specifies whether datetimes
returned by ``fetch()`` are normalised to the local system time
and include no timezone information (native), or are datetimes
self.assertEqual(imap.ssl, True)
self.assertEqual(imap.stream, False)
+ def test_SSL_kwargs(self):
+ self.imaplib.IMAP4_SSL.return_value = sentinel.IMAP4_SSL
+
+ imap = IMAPClient('1.2.3.4', ssl=True, keyfile='key.pem',
+ certfile='cert.pem')
+
+ self.assertEqual(imap._imap, sentinel.IMAP4_SSL)
+ self.imaplib.IMAP4_SSL.assert_called_with('1.2.3.4', 993,
+ keyfile='key.pem', certfile='cert.pem')
+ self.assertEqual(imap.ssl, True)
+ self.assertEqual(imap.stream, False)
+
+ imap = IMAPClient('1.2.3.4', ssl=True, ssl_context=None)
+ self.imaplib.IMAP4_SSL.assert_called_with('1.2.3.4', 993,
+ ssl_context=None)
+ self.assertEqual(imap.ssl, True)
+ self.assertEqual(imap.stream, False)
+
+
def test_stream(self):
self.imaplib.IMAP4_stream.return_value = sentinel.IMAP4_stream