On 04/11/2014 02:06 PM, Mark Sapiro wrote:
>>
>> Development question, is there a way to test the handler against a mail
>> content, outside of the full mailman context?
>>
>> Something like:
>>
>> $ python -some-useful-switch-here MyHandler.py < mymail_withheader.txt
> 
> 
> withlist is the tool for this. When I get a chance, I will update the
> above FAQ with a skeleton framework, but in short you need a withlist
> script that imports your handler, reads your message and builds a
> Mailman.Message.Message object and calls your handler's process function.


I have created a test script at
<http://www.msapiro.net/scripts/test_handler.py> (mirrored at
<http://fog.ccsf.cc.ca.us/~msapiro/scripts/test_handler.py>) which can
be used to unit test your handler against a test list and message and
optional metadata. I also updated the FAQ at
<http://wiki.list.org/x/l4A9> to point to this script.

-- 
Mark Sapiro <m...@msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan
------------------------------------------------------
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to