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

SQLAlchemyAttributeInterface class for Attribute Authority: added special attribute for mapping SAML attribute names to their respective SQL queries.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg_security_test/ndg/security/test/unit/attributeauthority/test_attributeauthority.py

    r5971 r5973  
    240240                     "Check the .msg files in this directory") 
    241241 
     242 
     243from warnings import warn 
    242244     
    243245class SQLAlchemyAttributeInterfaceTestCase(BaseTestCase): 
    244246    def __init__(self, *arg, **kw): 
    245247        super(SQLAlchemyAttributeInterfaceTestCase, self).__init__(*arg, **kw) 
     248        self.skipTests = False 
    246249        try: 
    247250            self._createDb() 
     251 
    248252        except NotImplementedError: 
    249             pass 
    250              
    251     def setUp(self): 
    252         pass 
     253            # Don't proceed with tests because SQLAlchemy is not installed 
     254            warn("Skipping SQLAlchemyAttributeInterfaceTestCase because " 
     255                 "SQLAlchemy is not installed") 
     256            self.skipTests = True 
    253257         
    254258    def test01(self): 
     259        if self.skipTests: 
     260            return 
     261         
    255262        attributeInterface = SQLAlchemyAttributeInterface() 
     263        attributeInterface.samlAttribute2SqlQueryMap_firstName = 'Philip' 
     264        setattr(attributeInterface, 'samlAttribute2SqlQueryMap.lastName', 
     265                'Kershaw') 
     266        attributeInterface.samlAttribute2SqlQueryMap['emailAddress'] = ('pjk' 
     267                                                            '@somewhere.ac.uk') 
     268 
    256269                                 
    257270if __name__ == "__main__": 
Note: See TracChangeset for help on using the changeset viewer.