Allows closing of the underlying socket.
Closes #173.
easier to use any unicode string as a search string and is safe
because Gmail supports UTF-8 search criteria.
* PEP8 compliance fixed (except for some occasional long lines)
+ * Added a "shutdown" method.
+ * The embedded six package has been removed in favour of using an
+ externally installed instance.
======
0.13
self._check_resp('BYE', 'logout', typ, data)
return data[0]
+ def shutdown(self):
+ """Close the connection to the IMAP server (without logging out)
+
+ In most cases, :py:meth:`.logout` should be used instead of
+ this. The logout method also shutdown down the connection.
+ """
+ self._imap.shutdown()
+
def id_(self, parameters=None):
"""Issue the ID command, returning a dict of server implementation
fields.
expected_error = "unexpected response while waiting for continuation response: \(u?'NO', \[u?'go away'\]\)"
with self.assertRaisesRegex(IMAPClient.AbortError, expected_error):
self.client._raw_command(b'FOO', [b'\xff'])
+
+
+class TestShutdown(IMAPClientTest):
+
+ def test_shutdown(self):
+ self.client.shutdown()
+ self.client._imap.shutdown.assert_called_once_with()