Create a test harness for BridgeDB
BridgeDB's tests are currently stored in lib/BridgeDB/Tests.py and use the standard library's
unittest module. Normally, Twisted code is tested with
twisted.trial, for the reason that if something returns a
twisted.internet.defer.Deferred the stdlib
unittest module doesn't know to wait for the result (nor does it understand how to clear the reactor).
Some things which should be done:
- We need a test runner which can pass on commands (i.e. doing "python setup.py test" would actually run "trial coverage [args] [tests/test directory]" and pass the arguments and test cases to coverage if need be. See tahoe-lafs's code for an example) and environment variables (i.e.
twisted.trialhas a conversion utility class for translating test results from stdlib
unittestinto something which
trial's reporter can use. I've never used it, but either some sort of conversion should be done of the old tests, or they should be rewritten.
- Find a way to write integration tests for the web interface.Windmill (more docs) and twill look promising. Windmill probably wouldn't run very nicely on a headless server, however, as it drives a browser.
- Find a way to write tests for the email responder.
Useful Resources: http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy