Mercurial > p > roundup > code
comparison test/test_jinja2.py @ 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 | |
| children | 3766e0ca8e7a |
comparison
equal
deleted
inserted
replaced
| 4963:cdfb1a3fb56f | 4964:2c3cc4ccd024 |
|---|---|
| 1 #-*- encoding: utf8 -*- | |
| 2 """ Testing the jinja2 templating engine of roundup-tracker. | |
| 3 | |
| 4 Copyright 2015 Bernhard E. Reiter <bernhard@intevation.de> | |
| 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 |
