Ignore:
Timestamp:
15/02/10 11:33:01 (11 years ago)
Author:
pjkersha
Message:

Working refactored Attribute Authority Client unit tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/NDGSecurity/python/ndg_security_common/ndg/security/common/saml_utils/binding/soap/attributequery.py

    r6570 r6572  
    4646    __slots__ = (__PRIVATE_ATTR_PREFIX + QUERY_ATTRIBUTES_ATTRNAME,) 
    4747 
     48    SERIALISE_KW = 'serialise' 
     49    DESERIALISE_KW = 'deserialise' 
    4850     
    4951    def __init__(self, **kw): 
    5052        '''Create SOAP Client for SAML Attribute Query''' 
    5153        self.__queryAttributes = TypedList(Attribute) 
    52                  
     54         
     55        # Default to ElementTree based serialisation/deserialisation 
     56        if AttributeQuerySOAPBinding.SERIALISE_KW not in kw: 
     57            from saml.xml.etree import AttributeQueryElementTree 
     58            kw[AttributeQuerySOAPBinding.SERIALISE_KW 
     59               ] = AttributeQueryElementTree.toXML 
     60                
     61        if AttributeQuerySOAPBinding.DESERIALISE_KW not in kw: 
     62            from saml.xml.etree import ResponseElementTree 
     63            kw[AttributeQuerySOAPBinding.DESERIALISE_KW 
     64               ] = ResponseElementTree.fromXML 
     65         
    5366        super(AttributeQuerySOAPBinding, self).__init__(**kw) 
    5467             
     
    148161            super(AttributeQuerySslSOAPBinding, self).__setattr__(name, value) 
    149162             
    150         except AttributeError: 
     163        except AttributeError, e: 
    151164            # Coerce into setting SSL Context Proxy attributes 
    152165            try: 
    153166                setattr(self.sslCtxProxy, name, value) 
    154167            except: 
    155                 raise 
     168                raise e 
Note: See TracChangeset for help on using the changeset viewer.