Hi, all -
Last week we talked about writing unittests for depcheck - Kamil and I tried to list a few required test cases, and I did a little experimenting with the unittest module in the depcheck branch. Here's an example test:
def test_depcheck_good_update(self): '''Make sure depcheck accepts a good update as expected''' (n, v, r) = ('mint', '2.0', '1') # twice as minty as mint 1.0! p = rpmfluff.SimpleRpmBuild(n,v,r) p.make() (rv, problems, ok_packages) = depcheck_main(self.mainrepo.id, [p.get_built_rpm(self.arch)]) self.assertEqual(len(problems), 1) self.assertTrue(problems[0].startswith(u'Success')) okp = ok_packages[0] self.assertEqual((n,v,r),(okp.name, okp.version, okp.release)) self.assertEqual(rv, 2) p.clean()
(there's a setUp method that creates a very simple repo which contains three packages - 'julep', which depends on 'mint' and 'bourbon = 1.0')
Kamil, is this the sort of thing you were thinking of? I think this makes sense but I'd love some input from the rest of you.
If you have a chance, check out the 'depcheck' branch and have a look at the unit tests, in tests/depcheck/depcheck.py. I'd love suggestions / more unittests / whatever.
Thanks!
-w