On Thu, 2007-02-15 at 12:24 -0500, James Bowes wrote: > Hi gang: > > So Seth's inPrcoRange stuff is perfect for unit tests. I added the > following to yum: > > yum/ > test/ > alltests.py > packagetests.py > settestpath.py > > > settestpath.py does sys.path manipulation, so you can run the unit tests > from all over the place. I'm not thrilled with it, so other solutions > are welcome. packagetests.py contains a simple test for inPrcoRange, and > alltests.py contains a suite that you can add other tests to, so that > all tests can be run from one file. > > There are other ways to gather up tests and suites (many of them using > magical introspection), but I find this layout, with its explicit > declarations of the tests, to be easiest for running all tests, or just > one module of tests. Though I'm all for less code, so suggest any > alternatives. >
James, So this is one of the first examples of unittests that I've read that make sense to me. I've never been good at grokking how they're supposed to be implemented and this one is pretty straightforward, thanks. The code in rpmUtils.updates is another good candidate for these tests. We can easily tell if the results are correct and provide reasonable examples. A lot of the items in rpmUtils.miscutils and yum.misc can also probably be tested. I'm not sure about a lot of other pieces but anywhere is a good start. Thanks for starting this. -sv _______________________________________________ Yum-devel mailing list [email protected] https://lists.dulug.duke.edu/mailman/listinfo/yum-devel
