source: TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/wsgi/saml/__init__.py @ 6578

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg-security/TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/wsgi/saml/__init__.py@6578
Revision 6578, 1.3 KB checked in by pjkersha, 11 years ago (diff)
  • Important fix for SOAP client used with SAML SOAP binding: set text/xml content type.
  • Refactored SAML SOAP binding query clients.
Line 
1"""Test SAML Attribute Query Interface
2
3NERC DataGrid Project
4"""
5__author__ = "P J Kershaw"
6__date__ = "21/08/09"
7__copyright__ = "(C) 2009 Science and Technology Facilities Council"
8__license__ = "BSD - see LICENSE file in top-level directory"
9__contact__ = "Philip.Kershaw@stfc.ac.uk"
10__revision__ = '$Id: $'
11import os
12import paste.fixture
13from paste.deploy import loadapp
14
15from ndg.security.test.unit import BaseTestCase
16
17
18class TestApp(object):
19    """Dummy application to terminate middleware stack containing SAML service
20    """
21    def __init__(self, global_conf, **app_conf):
22        pass
23   
24    def __call__(self, environ, start_response):
25        response = "404 Not Found"
26        start_response(response,
27                       [('Content-length', str(len(response))),
28                        ('Content-type', 'text/plain')])
29                           
30        return [response]
31
32
33class SoapSamlInterfaceMiddlewareTestCase(BaseTestCase):
34    HERE_DIR = os.path.dirname(os.path.abspath(__file__))
35    CONFIG_FILENAME = 'test.ini'
36   
37    def __init__(self, *args, **kwargs):
38        wsgiapp = loadapp('config:%s' % self.__class__.CONFIG_FILENAME, 
39                          relative_to=self.__class__.HERE_DIR)
40       
41        self.app = paste.fixture.TestApp(wsgiapp)
42         
43        BaseTestCase.__init__(self, *args, **kwargs)
Note: See TracBrowser for help on using the repository browser.