view test/test_jinja2.py @ 5031:867f7ddeef3d

Releasing 1.5.1 steps 12/16 8. python setup.py sdist --manifest-only 9. check the MANIFEST 10. python setup.py sdist 11. unpack the new dist and run tests and demo 12. added tag 1.5.1 for changeset 515ab1749b14
author anatoly techtonik <techtonik@gmail.com>
date Mon, 11 Jan 2016 23:31:43 +0300
parents 3766e0ca8e7a
children 63c79c0992ae
line wrap: on
line source

#-*- encoding: utf8 -*-
""" Testing the jinja2 templating engine of roundup-tracker.

Copyright: 2016 Intevation GmbH.
Author: 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 shutil # only, needed for tearDown. TODO: Remove when refactored.
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):
    """Sets up and tears down an instance with database contents.

    Setup and teardown modelled after the use of db_test_base
    by several modules like test_xmlrpc and test_userauditor.

    TODO: Should probably be moved to a base case in db_test_base.py.
    """

    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 tearDown(self):
        self.db.close()
        try:
            shutil.rmtree(self.dirname)
        except OSError, error:
            if error.errno not in (errno.ENOENT, errno.ESRCH): raise

    def test_zero(self):
        """Do nothing just make sure that setup and teardown works."""
        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.
    # for l in list_backends():
    for l in ['anydbm']:
        dct = dict(backend = l)
        subcls = type(TestCase)('TestCase_%s'%l, (TestCase,), dct)
        suite.addTest(unittest.makeSuite(subcls))

    return suite

# Other roundup test source files have an if __name__ == '__main__': here
# but I'm not sure if this is still helpful. So left out for now.

# vim: ts=4 et sts=4 sw=4 ai :



Roundup Issue Tracker: http://roundup-tracker.org/