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

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

Refactored Attribute Authority client unit tests separating out AA services into the config dir.

  • Property svn:keywords set to Id
Line 
1"""NDG Security Unit test package
2
3NERC Data Grid Project
4"""
5__author__ = "P J Kershaw"
6__date__ = "24/12/08"
7__copyright__ = "(C) 2007 STFC"
8__license__ = \
9"""This software may be distributed under the terms of the Q Public
10License, version 1.0 or later."""
11__contact__ = "Philip.Kershaw@stfc.ac.uk"
12__revision__ = '$Id$'
13
14import unittest
15import logging
16logging.basicConfig()
17
18import os
19from os.path import expandvars as xpdVars
20from os.path import join as jnPath
21
22
23class BaseTestCase(unittest.TestCase):
24    '''Convenience base class from which other unit tests can extend.  Its
25    sets the generic data directory path'''
26    configDirEnvVarName = 'NDGSEC_UNITTEST_CONFIG_DIR'
27   
28    def setUp(self):
29        if BaseTestCase.configDirEnvVarName not in os.environ:
30            os.environ[BaseTestCase.configDirEnvVarName] = \
31                os.path.join(os.path.abspath(os.path.dirname(__file__)),
32                             'config')
33
34mkDataDirPath = lambda file:jnPath(os.environ[BaseTestCase.configDirEnvVarName],
35                                   file)
36
Note: See TracBrowser for help on using the repository browser.