Re: Re: Re: rewrote tests in unittest/ to python unittests

"Joerg Beyer" <j.beyer-S0/[email protected]>
Newsgroups gmane.comp.tools.aap.devel
Organization http://freemail.web.de/
Message-ID <[email protected]>
Bram Moolenaar <[email protected]> schrieb am 05.08.03 14:50:02:
> 
> 
> Joerg Beyer wrote:
 
> You can blame me for this then.

I wont tell anybody...
 
> > > > I included the unittest.py (since Bram works with older
> > > > python releases that have it not includes - todays 
> > > > python releases have). It originally lives on:
> > > > pyunit.sourceforge.net
> > > 
> > > I'm using Python 2.2, which does include the module.  Since the module
> > 
> > oh, has changed recently? 

have you switched recently the python version, that you use 
to develop aap - sorry for the fuzzy question.

> Hmm, making an installable package recipe for this wouldn't be a bad
> idea.  If someone makes this I'll add it to the web site.  You can find
> examples here: http://www.a-a-p.org/packages/

actually this wget command should be enough:

wget -O unittest.py "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/pyunit/pyunit/unittest.py?rev=HEAD"

it downloads the current unittest.py from sf.net (via the Webinterface of the CVS).
 
> 
> > If you name a class that could be tested easliy (because it's
> > interaction with other object is small) then I will try to figure
> > out a unittest for it. Later, with a deeper understanding
> > of aap's internals it might be easier for me to write some
> > larger tests.
> 
> Most of the functions in Util.py and RecPython.py can be tested
> individually.  Functions in other modules might also be tested
> separately, but the more complex ones are probably better done by
> executing a recipe.

the unittests could be done in layers: lower level functions/methods/
object at first. Then the compound objects. Later the integration tests.

I take a look at Util.py, RecPython.py later, maybe tonight.
 
> > One thing that _should_ be unittest'ed is the aap-rule engine,
> > but right now, I dont understand it good enough. One could
> > provide a ruleset and trigger certain targets, expecting (or better:
> > asserting) the right action to be triggered.
> 
> This isn't simple, but should be possible.  It involves creating a Work
> object, adding items to it and then calling dictlist_update().
> 

with unittests on that level, you could detect breaks sure and fast.

    Joerg



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.