Mercurial > p > roundup > code
changeset 4964:2c3cc4ccd024
Automatic tests: added some notes to the readme and a test_jinja2 stub.
| author | Bernhard Reiter <bernhard@intevation.de> |
|---|---|
| date | Mon, 16 Feb 2015 17:43:58 +0100 |
| parents | cdfb1a3fb56f |
| children | a850f8bae536 |
| files | test/README.txt test/test_jinja2.py |
| diffstat | 2 files changed, 82 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/test/README.txt Tue Feb 10 14:08:01 2015 +1100 +++ b/test/README.txt Mon Feb 16 17:43:58 2015 +0100 @@ -1,3 +1,33 @@ +A number of tests uses the infrastructure of + db_test_base.py + +grep "from db_test_base" -l *.py +benchmark.py +session_common.py +test_anydbm.py +test_indexer.py +test_memorydb.py +test_mysql.py +test_postgresql.py +test_security.py +test_sqlite.py +test_tsearch2.py +test_userauditor.py + +grep "import db_test_base" -l *.py +test_cgi.py +test_jinja2.py +test_mailgw.py +test_xmlrpc.py + +grep "import memory\|from memory" -l *.py +test_mailgw.py +test_memorydb.py + + +The remaining lines are an 2001 description from Richard, +which probably is outdated: + Structure of the tests: 1 Test date classes
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/test_jinja2.py Mon Feb 16 17:43:58 2015 +0100 @@ -0,0 +1,52 @@ +#-*- encoding: utf8 -*- +""" Testing the jinja2 templating engine of roundup-tracker. + +Copyright 2015 Bernhard E. Reiter <bernhard@intevation.de> +This module is Free Software under the Roundup licensing of 1.5, +see the COPYING.txt file coming with Roundup. + +Just a test file template for now. +""" +import unittest + +import db_test_base + +TESTSUITE_IDENTIFIER='jinja2' + +class TestCase_Zero(unittest.TestCase): + def test_zero(self): + self.assertEqual(True, True) + +class TestCase(unittest.TestCase): + + backend = None # can be used to create tests per backend, see test_xmlrpc + + def setUp(self): + self.dirname = '_test_' + TESTSUITE_IDENTIFIER + self.instance = db_test_base.setupTracker(self.dirname, self.backend) + self.db = self.instance.open('admin') + + def test_zero(self): + pass + +def test_suite(): + suite = unittest.TestSuite() + + suite.addTest(unittest.makeSuite(TestCase_Zero)) + + # only using one database backend for now, not sure if doing all + # backends will keep the test focussed enough to be useful for the used + # computing time. Would be okay to change in the future. + l = 'anydbm' + dct = dict(backend = l) + subcls = type(TestCase)('TestCase_%s'%l, (TestCase,), dct) + suite.addTest(unittest.makeSuite(subcls)) + + return suite + +# Other roundup testcases do have a def main thing in there, +# but I'm not sure if this is still helpful. So left out for now. + +# vim: ts=4 et sts=4 sw=4 ai : + +
