Ignore:
Timestamp:
15/02/10 09:24:37 (10 years ago)
Author:
pjkersha
Message:

Refactored SAML SOAP Binding unit test class into a separate module test_samlattributeauthorityclient

Location:
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/attributeauthorityclient
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/attributeauthorityclient

    • Property svn:ignore
      •  

        old new  
        11*.pem 
         2ac-clnt.xml 
         3ac-clnt-test6.xml 
         4mapped-ac.xml 
  • TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/attributeauthorityclient/__init__.py

    r4840 r6571  
    99__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    1010__revision__ = '$Id$' 
     11from os import path, environ 
     12 
     13from ndg.security.test.unit import BaseTestCase, mkDataDirPath 
     14from ndg.security.common.X509 import X509Cert 
     15from ndg.security.common.utils.configfileparsers import ( 
     16    CaseSensitiveConfigParser) 
     17 
     18 
     19class AttributeAuthorityClientBaseTestCase(BaseTestCase): 
     20    """Base class for NDG and SAML Attribute Authority client interfaces""" 
     21    CONFIG_FILENAME = 'attAuthorityClientTest.cfg' 
     22     
     23    def __init__(self, *arg, **kw): 
     24        super(AttributeAuthorityClientBaseTestCase, self).__init__(*arg, **kw) 
     25 
     26        if 'NDGSEC_AACLNT_UNITTEST_DIR' not in environ: 
     27            environ['NDGSEC_AACLNT_UNITTEST_DIR' 
     28                                        ] = path.abspath(path.dirname(__file__)) 
     29 
     30        self.cfgParser = CaseSensitiveConfigParser() 
     31        self.cfgFilePath = path.join(environ['NDGSEC_AACLNT_UNITTEST_DIR'], 
     32                                     self.__class__.CONFIG_FILENAME) 
     33        self.cfgParser.read(self.cfgFilePath) 
     34         
     35        self.cfg = {} 
     36        for section in self.cfgParser.sections(): 
     37            self.cfg[section] = dict(self.cfgParser.items(section)) 
     38 
     39        try: 
     40            self.sslCACertList = [X509Cert.Read(xpdVars(caFile))  
     41                                  for caFile in self.cfg['setUp'][ 
     42                                            'sslcaCertFilePathList'].split()] 
     43        except KeyError: 
     44            self.sslCACertList = [] 
     45             
     46        self.startAttributeAuthorities()         
Note: See TracChangeset for help on using the changeset viewer.