Add framework for testing

This commit is contained in:
Stein Magnus Jodal 2009-12-23 22:15:53 +01:00
parent 69cee7bd08
commit 47d0949666
5 changed files with 43 additions and 0 deletions

3
.gitignore vendored
View File

@ -1,2 +1,5 @@
*.pyc *.pyc
*.swp *.swp
.coverage
src/
pip-log.txt

View File

@ -92,3 +92,16 @@ To start mopidy, go to the root of the mopidy project, then simply run::
To stop mopidy, press ``CTRL+C``. To stop mopidy, press ``CTRL+C``.
Running tests
-------------
To run tests, you need a couple of dependiencies which can be installed using
pip::
pip install -r test-requirements.txt
Then, to run all tests::
python tests

2
test-requirements.txt Normal file
View File

@ -0,0 +1,2 @@
coverage
-e bzr+http://liw.iki.fi/bzr/coverage-test-runner/trunk/#egg=CoverageTestRunner

17
tests/__main__.py Normal file
View File

@ -0,0 +1,17 @@
#! /usr/bin/env python
import os
import sys
from CoverageTestRunner import CoverageTestRunner
sys.path.insert(0,
os.path.abspath(os.path.join(os.path.dirname(__file__), '../')))
def main():
r = CoverageTestRunner()
r.add_pair('mopidy/handler.py', 'tests/handlertest.py')
r.run()
if __name__ == '__main__':
main()

8
tests/handlertest.py Normal file
View File

@ -0,0 +1,8 @@
import unittest
class HandlerTest(unittest.TestSuite):
def setUp():
pass
def testEverythingOk():
pass