Ignore:
Timestamp:
24/07/09 14:57:03 (11 years ago)
Author:
pjkersha
Message:

Started work on SAML Attribute Interface SOAP Binding

  • added new ndg.security.common.soap module for ElementTree based SOAP handling. This will allow easy integration with ElementTree based SAML implementation.
File:
1 edited

Legend:

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

    r5513 r5516  
    3535    pass 
    3636 
     37class SamlSoapBindingMiddleware(object): 
     38    def __call__(self, environ, start_response): 
     39        pass 
    3740 
    38 class SamlAttributeAuthorityInterfaceTestCase(BaseTestCase): 
     41         
     42class SamlAttributeAuthorityInterfaceTestCase(unittest.TestCase): 
    3943    """TODO: test SAML Attribute Authority interface""" 
    4044    thisDir = os.path.dirname(os.path.abspath(__file__)) 
     45 
     46    def __init__(self, *args, **kwargs): 
     47        wsgiApp = SamlSoapBindingMiddleware() 
     48        self.app = paste.fixture.TestApp(wsgiApp) 
     49          
     50        unittest.TestCase.__init__(self, *args, **kwargs) 
     51         
     52 
     53    def test01Catch401WithNotLoggedIn(self): 
     54        response = self.app.get('/test_401WithNotLoggedIn') 
     55        self.assert_(response.status == 302) 
     56         
     57        try: 
     58            redirectResponse = response.follow() 
     59        except paste.fixture.AppError, e: 
     60            self.failIf('404 Not found' not in str(e),  
     61                        "Expecting 404 Not found") 
     62 
     63    def test02Skip200WithLoggedIn(self): 
     64        response = self.app.get('/test_200WithLoggedIn', 
     65                                extra_environ={'REMOTE_USER': 'testuser'}) 
     66 
     67    def test03Catch401WithLoggedIn(self): 
     68        response = self.app.get('/test_401WithLoggedIn',  
     69                                extra_environ={'REMOTE_USER': 'testuser'}, 
     70                                status=401) 
     71         
     72    def test04Catch200WithNotLoggedIn(self): 
     73        response = self.app.get('/test_200WithNotLoggedIn') 
     74        self.assert_(response.status == 302) 
     75         
     76        try: 
     77            redirectResponse = response.follow() 
     78        except paste.fixture.AppError, e: 
     79            self.failIf('404 Not found' not in str(e),  
     80                        "Expecting 404 Not found") 
    4181     
    42     def test01(self): 
    43         pass 
    4482     
    4583 
Note: See TracChangeset for help on using the changeset viewer.