source: TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/__init__.py @ 5290

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/__init__.py@5290
Revision 5290, 1.0 KB checked in by pjkersha, 10 years ago (diff)

Reworking unit tests

RevLine 
[5290]1"""NDG Security unit test package
2
3NERC Data Grid Project
4"""
5__author__ = "P J Kershaw"
6__date__ = "14/05/09"
7__copyright__ = "(C) 2009 Science and Technology Facilities Council"
8__license__ = "BSD - see LICENSE file in top-level directory"
9__contact__ = "Philip.Kershaw@stfc.ac.uk"
10__revision__ = '$Id: __init__.py 4840 2009-01-19 13:59:08Z pjkersha $'
11
12import unittest
13import logging
14logging.basicConfig()
15
16import os
17from os.path import expandvars, join, dirname, abspath
18
19
20class BaseTestCase(unittest.TestCase):
21    '''Convenience base class from which other unit tests can extend.  Its
22    sets the generic data directory path'''
23    configDirEnvVarName = 'NDGSEC_TEST_CONFIG_DIR'
24   
25    def setUp(self):
26        if BaseTestCase.configDirEnvVarName not in os.environ:
27            os.environ[BaseTestCase.configDirEnvVarName] = \
28                join(abspath(dirname(dirname(__file__))), 'config')
29
30mkDataDirPath = lambda file:join(os.environ[BaseTestCase.configDirEnvVarName],
31                                 file)
32
Note: See TracBrowser for help on using the repository browser.