OZtree
OZtree copied to clipboard
Add unit tests for all the controllers
In https://github.com/OneZoom/OZtree/commit/43efa1ef524b83436d45ce74a09f8f00c1e53c6d I added a basic set of tests for the standard functions in the default controller - just checking that they don't bug out with a blank call. If this looks OK to @lentinj, I think we should also add tests for the other controllers (we already have test_controllers_API.py, so this would be test_controllers_tree.py, test_controllers_treeviewer.py, etc).
Seems eminently sensible. Would be nice to avoid the special-case lists though, could you do something like...
- If a 400 is raised, try again with an OTT and see if that works.
- If
selfhas a method name oftest_{name}or starting withtest_{name}_, skip testing that one (since it has it's own tests).
The latter is also useful for things that won't work with the generic tests, so instead of adding to the list you could do e.g:
def test_sponsor_pay(self):
raise unittest.SkipTest("TODO: Tests not implemented")
...and leave an obvious hole for the real tests to go in.
This is a duplicate of #410