saltstack/salt — pull request #407 by mb0 (2011-12-30 23:31:13+00:00)
Title: Test cmd and bug #403 fix

while working on salt i got pretty annoyed testing my code. i had to reinstall salt, restart salt-master and salt-call some module to look at its output after each change just to verify that i still had errors in my code.

so i wrote a test command so we can add a unittest.TestCase to the tests/ folder and simply run 'time ./setup.py test' to be amazed how fast we now can build and test our work :).

while tests are a couple more lines to write, they payout as safety net when refactoring code or adding new features. for me they even accelerate the implementation of simple parsers or algorithms. and they usually help other developers and advanced users to understand how the code should work.

as an example i added tests for the jinja loader and hosts module and fixed bug saltstack/salt#403 while at it.