source: TI12-security/trunk/python/ndg_security_test/ndg/security/test/unit/myproxy/certificate_extapp/test_saml_attribute_assertion.py @ 5924

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg_security_test/ndg/security/test/unit/myproxy/certificate_extapp/test_saml_attribute_assertion.py@5924
Revision 5924, 1.5 KB checked in by pjkersha, 10 years ago (diff)

Initial unit tests for MyProxy? callout app

Line 
1#!/usr/bin/env python
2"""Unit tests for NDG Security MyProxy Extensions callout for adding SAML
3Attribute Assertions to issued X.509 Certificates
4
5NERC DataGrid Project
6"""
7__author__ = "P J Kershaw"
8__date__ = "29/10/09"
9__copyright__ = "(C) 2009 Science and Technology Facilities Council"
10__license__ = "BSD - see LICENSE file in top-level directory"
11__contact__ = "Philip.Kershaw@stfc.ac.uk"
12__revision__ = '$Id:$'
13import logging
14logging.basicConfig(level=logging.DEBUG)
15
16from ndg.security.test.unit import BaseTestCase
17from ndg.security.server.myproxy.certificate_extapp.saml_attribute_assertion \
18    import SamlAssertionMyProxyCertExtApp
19   
20
21class SamlAssertionMyProxyCertExtAppTestCase(BaseTestCase):
22    def __init__(self, *arg, **kw):
23        super(SamlAssertionMyProxyCertExtAppTestCase, self).__init__(*arg, 
24                                                                     **kw)           
25        self.startSiteAAttributeAuthority()
26       
27    def test01(self):
28        myProxyCertExtApp = SamlAssertionMyProxyCertExtApp()
29        myProxyCertExtApp.attributeAuthorityURI = ('http://localhost:%d'
30                                                   '/AttributeAuthority/saml' % 
31        SamlAssertionMyProxyCertExtAppTestCase.SITEA_ATTRIBUTEAUTHORITY_PORTNUM
32        )
33        myProxyCertExtApp.issuerDN = "/O=Site A/CN=Authorisation Service"
34        myProxyCertExtApp.userOpenID = "https://openid.localhost/philip.kershaw"
35        assertion = myProxyCertExtApp.attributeQuery()
36        print(assertion)
Note: See TracBrowser for help on using the repository browser.