Package ndg :: Package saml :: Package test :: Package binding :: Package soap :: Module test_queryinterface
[hide private]

Source Code for Module ndg.saml.test.binding.soap.test_queryinterface

 1  #!/usr/bin/env python 
 2  """Unit tests for WSGI SAML 2.0 SOAP Attribute Query Interface 
 3   
 4  NERC DataGrid Project 
 5  """ 
 6  __author__ = "P J Kershaw" 
 7  __date__ = "03/11/10" 
 8  __copyright__ = "(C) 2010 Science and Technology Facilities Council" 
 9  __license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
10  __contact__ = "Philip.Kershaw@stfc.ac.uk" 
11  __revision__ = '$Id$' 
12  import unittest 
13   
14  from datetime import timedelta 
15  from ndg.saml.saml2.binding.soap.server.wsgi.queryinterface import \ 
16      SOAPQueryInterfaceMiddleware 
17       
18  from ndg.saml.xml.etree import AttributeQueryElementTree     
19  from ndg.saml.xml.etree import ResponseElementTree 
20   
21   
22 -class SOAPQueryInterfaceMiddlewareTestCase(unittest.TestCase):
23 """Test Setting of SOAP Query Interface middleware attributes""" 24
25 - def test01Create(self):
26 queryIface = SOAPQueryInterfaceMiddleware(None) 27 config = { 28 'mountPath': '/attribute-authority', 29 'queryInterfaceKeyName': 'QUERY_IFACE_KEY', 30 'deserialise': 'ndg.saml.xml.etree:AttributeQueryElementTree.fromXML', 31 'serialise': 'ndg.saml.xml.etree:ResponseElementTree.toXML', 32 'clockSkewTolerance': 60*3 33 } 34 queryIface.initialise({}, **config) 35 self.assert_(queryIface.mountPath == '/attribute-authority') 36 self.assert_(queryIface.queryInterfaceKeyName == 'QUERY_IFACE_KEY') 37 self.assert_(queryIface.deserialise == \ 38 AttributeQueryElementTree.fromXML) 39 self.assert_(queryIface.serialise == ResponseElementTree.toXML) 40 self.assert_(queryIface.clockSkewTolerance == timedelta(seconds=60*3))
41 42 43 if __name__ == "__main__": 44 unittest.main() 45