1 | """Test SAML Attribute Query Interface |
---|
2 | |
---|
3 | NERC 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$' |
---|
11 | import os |
---|
12 | import paste.fixture |
---|
13 | from paste.deploy import loadapp |
---|
14 | |
---|
15 | from ndg.security.test.unit import BaseTestCase |
---|
16 | |
---|
17 | |
---|
18 | class 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 | |
---|
33 | class 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) |
---|