testing hooks

Bill Barry after.fallout at gmail.com
Fri Aug 1 12:08:43 CDT 2008


I have a hook for connecting mercurial to bugzilla (3.0+) and I wanted 
to test it to make sure it works. Are there any established testing 
mechanics I should consider (libraries and such). This is the first time 
I have ever written any kind of substantial python code and I am not 
sure what I am doing.

I think I would want to mock out the functionality from mercurial that I 
am using:

from mercurial.i18n import _
from mercurial.node import short
from mercurial import cmdutil, templater, util


and also the functionality included in the python distribution:

import os, re, time, subprocess

Perhaps also writing some sort of test to ensure that all of these 
libraries exist and are usable from my hook.

What should I do to go about working on this?

PS. if anyone is interested, the hook is available at: 
https://systems-300.stellarfinancial.com/pub/Bill/file/tip/Random/bugzilla.py
Apparently it isn't working (though I don't know why, it is just a 
cleaned up version of the one I am actually using which is working, I 
basically just renamed some variables).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://selenic.com/pipermail/mercurial/attachments/20080801/7923622b/attachment.htm 


More information about the Mercurial mailing list