From: Menno Smits Date: Tue, 30 Jun 2015 02:40:59 +0000 (+1200) Subject: Added some guidance on writing unit tests to HACKING.rst X-Git-Tag: 0.13~1^2~2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=13746232e9833473d5038625361fe951426d4422;p=imapclient.git Added some guidance on writing unit tests to HACKING.rst Fixes #149. --- diff --git a/HACKING.rst b/HACKING.rst index 78c331c..90b2646 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -89,3 +89,12 @@ the unit tests against the Python versions officially supported by IMAPClient (provided these versions of Python are installed!). .. _`tox`: http://testrun.org/tox/ + +Writing Unit Tests +================== +Protocol level unit tests should not act against a real IMAP server +but should use canned data instead. The IMAPClientTest base class +should typically be used as the base class for any tests - it provides +a mock IMAPClient instance at `self.client`. See the tests in +imapclient/tests/test_imapclient.py for examples of how to write unit +tests using this approach.