Skip to content

Commit 24c1ae3

Browse files
Automatic tests: added some notes to the readme and a test_jinja2 stub.
1 parent 3a7410d commit 24c1ae3

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

test/README.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
A number of tests uses the infrastructure of
2+
db_test_base.py
3+
4+
grep "from db_test_base" -l *.py
5+
benchmark.py
6+
session_common.py
7+
test_anydbm.py
8+
test_indexer.py
9+
test_memorydb.py
10+
test_mysql.py
11+
test_postgresql.py
12+
test_security.py
13+
test_sqlite.py
14+
test_tsearch2.py
15+
test_userauditor.py
16+
17+
grep "import db_test_base" -l *.py
18+
test_cgi.py
19+
test_jinja2.py
20+
test_mailgw.py
21+
test_xmlrpc.py
22+
23+
grep "import memory\|from memory" -l *.py
24+
test_mailgw.py
25+
test_memorydb.py
26+
27+
28+
The remaining lines are an 2001 description from Richard,
29+
which probably is outdated:
30+
131
Structure of the tests:
232

333
1 Test date classes

test/test_jinja2.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#-*- encoding: utf8 -*-
2+
""" Testing the jinja2 templating engine of roundup-tracker.
3+
4+
Copyright 2015 Bernhard E. Reiter <[email protected]>
5+
This module is Free Software under the Roundup licensing of 1.5,
6+
see the COPYING.txt file coming with Roundup.
7+
8+
Just a test file template for now.
9+
"""
10+
import unittest
11+
12+
import db_test_base
13+
14+
TESTSUITE_IDENTIFIER='jinja2'
15+
16+
class TestCase_Zero(unittest.TestCase):
17+
def test_zero(self):
18+
self.assertEqual(True, True)
19+
20+
class TestCase(unittest.TestCase):
21+
22+
backend = None # can be used to create tests per backend, see test_xmlrpc
23+
24+
def setUp(self):
25+
self.dirname = '_test_' + TESTSUITE_IDENTIFIER
26+
self.instance = db_test_base.setupTracker(self.dirname, self.backend)
27+
self.db = self.instance.open('admin')
28+
29+
def test_zero(self):
30+
pass
31+
32+
def test_suite():
33+
suite = unittest.TestSuite()
34+
35+
suite.addTest(unittest.makeSuite(TestCase_Zero))
36+
37+
# only using one database backend for now, not sure if doing all
38+
# backends will keep the test focussed enough to be useful for the used
39+
# computing time. Would be okay to change in the future.
40+
l = 'anydbm'
41+
dct = dict(backend = l)
42+
subcls = type(TestCase)('TestCase_%s'%l, (TestCase,), dct)
43+
suite.addTest(unittest.makeSuite(subcls))
44+
45+
return suite
46+
47+
# Other roundup testcases do have a def main thing in there,
48+
# but I'm not sure if this is still helpful. So left out for now.
49+
50+
# vim: ts=4 et sts=4 sw=4 ai :
51+
52+

0 commit comments

Comments
 (0)