- Timestamp:
- 15/02/10 12:33:41 (11 years ago)
- Location:
- TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/wsgi/saml
- Files:
-
- 2 added
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/wsgi/saml/__init__.py
r6069 r6574 9 9 __contact__ = "Philip.Kershaw@stfc.ac.uk" 10 10 __revision__ = '$Id: $' 11 import unittest 12 import os 13 import paste.fixture 14 from paste.deploy import loadapp 15 16 17 class TestApp(object): 18 def __init__(self, global_conf, **app_conf): 19 pass 20 21 def __call__(self, environ, start_response): 22 response = "404 Not Found" 23 start_response(response, 24 [('Content-length', str(len(response))), 25 ('Content-type', 'text/plain')]) 26 27 return [response] 28 29 30 class SOAPAttributeInterfaceMiddlewareTestCase(unittest.TestCase): 31 HERE_DIR = os.path.dirname(os.path.abspath(__file__)) 32 CONFIG_FILENAME = 'test.ini' 33 34 def __init__(self, *args, **kwargs): 35 wsgiapp = loadapp( 36 'config:%s' % \ 37 SOAPAttributeInterfaceMiddlewareTestCase.CONFIG_FILENAME, 38 relative_to=SOAPAttributeInterfaceMiddlewareTestCase.HERE_DIR) 39 40 self.app = paste.fixture.TestApp(wsgiapp) 41 42 unittest.TestCase.__init__(self, *args, **kwargs) -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/wsgi/saml/attribute-interface.ini
r5663 r6574 21 21 22 22 [filter:SAMLSoapAttributeInterfaceFilter] 23 paste.filter_app_factory = ndg.security.server.wsgi.saml :SOAPAttributeInterfaceMiddleware.filter_app_factory23 paste.filter_app_factory = ndg.security.server.wsgi.saml.attributeinterface:SOAPAttributeInterfaceMiddleware.filter_app_factory 24 24 prefix = saml. 25 25 saml.pathMatchList = /attributeauthority/saml -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/wsgi/saml/test_soapattributeinterface.py
r6069 r6574 10 10 __contact__ = "Philip.Kershaw@stfc.ac.uk" 11 11 __revision__ = '$Id: $' 12 import unittest13 import os14 12 from uuid import uuid4 15 13 from datetime import datetime 16 17 import paste.fixture18 from paste.deploy import loadapp19 20 14 from cStringIO import StringIO 21 15 … … 27 21 28 22 from ndg.security.common.soap.etree import SOAPEnvelope 29 from ndg.security.common.utils.etree import prettyPrint30 23 from ndg.security.common.saml_utils.esg import EsgSamlNamespaces 31 32 33 class TestApp(object):34 def __init__(self, global_conf, **app_conf):35 pass36 37 def __call__(self, environ, start_response):38 response = "404 Not Found"39 start_response(response,40 [('Content-length', str(len(response))),41 ('Content-type', 'text/plain')])42 43 return [response]44 24 45 25 46 26 class SOAPAttributeInterfaceMiddlewareTestCase(unittest.TestCase): 47 48 def __init__(self, *args, **kwargs): 49 here_dir = os.path.dirname(os.path.abspath(__file__)) 50 wsgiapp = loadapp('config:test.ini', relative_to=here_dir) 51 self.app = paste.fixture.TestApp(wsgiapp) 52 53 unittest.TestCase.__init__(self, *args, **kwargs) 54 27 CONFIG_FILENAME = 'attribute-interface.ini' 28 55 29 def _createAttributeQuery(self, 56 30 issuer="/O=Site A/CN=Authorisation Service", … … 246 220 self.assert_(samlResponse.status.statusCode.value == \ 247 221 StatusCode.UNKNOWN_PRINCIPAL_URI) 248 222 223 249 224 if __name__ == "__main__": 250 225 unittest.main()
Note: See TracChangeset
for help on using the changeset viewer.