h01ger/piuparts — pull request #3 by mattthias (2014-01-27 10:14:58+00:00)
Title: Add / rework tests for piuparts.py

Hi Holger,

this pull request contains four commits:

The first commit removes the unittest class from piuparts.py and moves it to the test_piuparts.py in the tests directory. Now nosetests can discover and run the test and it also shows up in the code coverage.
eb5ae19	piuparts.py: Move unittests to the tests/ directory

The second commit adds unittests for the DefaultFactory and the Defaults[Debian|Ubuntu] classes.
It introduces pymox as mocking framework to mock out the panic() function (as it would kill the program with sys.exit()) and the guess_flavor() function as it would run a lsb_release in a subprocess. Pymox will also come handy when it comes to the functions that use urrlib to fetch the package files in piupartslib but this is another story (and upcoming pull request ;-) ).
2b350a9	piuparts.py: Add unittest for DefaultsFactory / Defaults

This commit only adds a README file to the tests directory. I try to document the naming of the test classes / functions (mostly because i am sure that i didn't remeber how to name the classes in some weeks ;-) ).
6f43b50 unittests: Add tests/README

This commit adds the above changes to the debian/changelog:
eebb57c Document the changes in d/changelog