[TIP] (Unit | Functional) testing of imaplib apps .

Tom Wardill tom at howrandom.net
Mon Nov 1 12:31:32 PDT 2010


On Mon, 2010-11-01 at 08:46 -0500, Olemis Lang wrote:
> Hi !
> 
> I'm developing an IMAP4-based app using `imaplib` . I'd like to know
> what's used to either mock (for unit tests) or launch a lightweight
> (in-memory ?) IMAP server (for functional tests), and how to
> setup all this at testing-time.
> 
> Right now what I do is to use a local `hMailServer` instance on
> Windows , but it's so «lightweight» that I even had to install
> MySql and ... to make it work . So I'm hoping there's something
> out there like `twill` or `wsgi_intercept` that may help under
> these circumstances .
> 
> Thnx in advance !
> 
> 


Hi.

In a similar situation, I created this:

http://github.com/tomwardill/FakeEmail

It's a standalone server, using twisted to run, so perhaps not as
lightweight as could be, but is in memory (and multi threaded), and
allows JSON access as well as web based for functional testing/poking.
Has a buildout for easy installation, should work pretty much wherever
python is available.

Hope this helps, suggestions to make it better accepted eagerly.

-- 
Tom Wardill




More information about the testing-in-python mailing list