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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/wsgi/saml/__init__.py@6575
Revision 6575, 1.2 KB checked in by pjkersha, 11 years ago (diff)

Changes for addition of AuthzDecisionQuery? WSGI interface (Authorisation service)

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
17class 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
30class SoapSamlInterfaceMiddlewareTestCase(BaseTestCase):
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('config:%s' % self.__class__.CONFIG_FILENAME, 
36                          relative_to=self.__class__.HERE_DIR)
37       
38        self.app = paste.fixture.TestApp(wsgiapp)
39         
40        unittest.TestCase.__init__(self, *args, **kwargs)
Note: See TracBrowser for help on using the repository browser.