source: TI12-security/trunk/NDG_XACML/ndg/xacml/test/test_matchfunctions.py @ 7072

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDG_XACML/ndg/xacml/test/test_matchfunctions.py@7072
Revision 7072, 1022 bytes checked in by pjkersha, 9 years ago (diff)

Incomplete - task 2: XACML-Security Integration

  • Major cleanup of function factories for efficiency. Only the required factories and function classes are loaded and any loaded classes are cached for future calls. All unit tests pass.
  • Property svn:keywords set to Id
Line 
1#!/usr/bin/env python
2"""NDG XACML functions unit test package
3
4NERC DataGrid Project
5"""
6__author__ = "P J Kershaw"
7__date__ = "26/03/10"
8__copyright__ = "(C) 2010 Science and Technology Facilities Council"
9__contact__ = "Philip.Kershaw@stfc.ac.uk"
10__license__ = "BSD - see LICENSE file in top-level directory"
11__contact__ = "Philip.Kershaw@stfc.ac.uk"
12__revision__ = "$Id$"
13import unittest
14from os import path
15import logging
16logging.basicConfig(level=logging.DEBUG)
17
18from ndg.xacml.core.functions import FunctionMap
19from ndg.xacml.core.functions.v2.regexp_match import RegexpMatchBase
20
21
22class FunctionTestCase(unittest.TestCase):
23    """Test XACML match functions implementation"""
24   
25    def test01LoadMap(self):   
26        funcMap = FunctionMap()
27        funcMap.load()
28        anyUriMatchNs = \
29            'urn:oasis:names:tc:xacml:2.0:function:anyURI-regexp-match'
30           
31        self.assert_(issubclass(funcMap.get(anyUriMatchNs), RegexpMatchBase))
32
33       
34if __name__ == "__main__":
35    unittest.main()
Note: See TracBrowser for help on using the repository browser.