Changeset 5291


Ignore:
Timestamp:
14/05/09 17:13:33 (10 years ago)
Author:
pjkersha
Message:

Completed fixes to unit tests for move to 'unit' package.

Location:
TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/__init__.py

    r5290 r5291  
    3131                                 file) 
    3232 
     33def _getParentDir(depth=0, path=dirname(__file__)): 
     34    """ 
     35    @type path: basestring 
     36    @param path: directory path from which to get parent directoty, defaults 
     37    to dir of this module 
     38    @rtype: basestring 
     39    @return: parent directory at depth levels up from the current path 
     40    """ 
     41    for i in range(depth): 
     42        path = dirname(path) 
     43    return path 
     44 
     45 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wsgi/authn/test_authn.py

    r5290 r5291  
    8484                                extra_environ={'REMOTE_USER': 'testuser'}, 
    8585                                status=403) 
    86         self.assert_(response.status == 403) 
    8786 
    8887    def test03Catch401WithLoggedIn(self): 
    89         try: 
    90             response = self.app.get('/test_401WithLoggedIn') 
    91              
    92         except paste.fixture.AppError, e: 
    93             self.failIf('403 Forbidden' not in str(e), 
    94                         "Expecting 403 Forbidden status") 
     88        response = self.app.get('/test_401WithLoggedIn',  
     89                                extra_environ={'REMOTE_USER': 'testuser'}, 
     90                                status=403) 
    9591         
    9692    def test04Catch200WithNotLoggedIn(self): 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wssecurity/dom/server/echoServer.py

    r5290 r5291  
    1414from EchoService_services_server import EchoService as _EchoService 
    1515 
    16 from ndg.security.common.wssecurity.signaturehandler.dom import SignatureHandler 
     16from ndg.security.common.wssecurity.signaturehandler.dom import \ 
     17    SignatureHandler 
    1718 
    1819from os.path import expandvars as xpdVars 
     
    2728 
    2829 
    29 from ndg.security.test.unit import BaseTestCase 
     30from ndg.security.test.unit import BaseTestCase, _getParentDir 
    3031 
    3132# Initialize environment for unit tests 
    3233if BaseTestCase.configDirEnvVarName not in os.environ: 
    3334    os.environ[BaseTestCase.configDirEnvVarName] = \ 
    34                 join(dirname(dirname(abspath(dirname(__file__)))), 'config') 
     35                            join(abspath(_getParentDir(depth=1)), 'config') 
    3536 
    3637class EchoService(_EchoService): 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wssecurity/foursuite/client/echoClientTest.cfg

    r5290 r5291  
    1313signingCertFilePath = $NDGSEC_TEST_CONFIG_DIR/pki/wsse-clnt.crt 
    1414 
    15 # - NB, the two CA certificates are for the python and the java clients, respectively 
    16 caCertFilePathList = $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt $NDGSEC_WSSECLNT_UNITTEST_DIR/cacert.pem 
     15# - NB, the two CA certificates are for the python and the java clients,  
     16# respectively 
     17caCertFilePathList = $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    1718 
    1819[test1Echo] 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wssecurity/foursuite/server/echoServer.py

    r5290 r5291  
    2828 
    2929 
    30 from ndg.security.test.unit import BaseTestCase 
     30from ndg.security.test.unit import BaseTestCase, _getParentDir 
    3131 
    3232# Initialize environment for unit tests 
    3333if BaseTestCase.configDirEnvVarName not in os.environ: 
    3434    os.environ[BaseTestCase.configDirEnvVarName] = \ 
    35                 join(dirname(dirname(abspath(dirname(__file__)))), 'config') 
     35                            join(abspath(_getParentDir(depth=1)), 'config') 
    3636 
    3737class EchoService(_EchoService): 
Note: See TracChangeset for help on using the changeset viewer.