source: TI12-security/trunk/ndg_xacml/ndg/xacml/test/test_functions.py @ 7668

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/ndg_xacml/ndg/xacml/test/test_functions.py@7668
Revision 7668, 1.1 KB checked in by pjkersha, 10 years ago (diff)

Modified apply and match classes to use a FunctionMap? class singleton to enable easy addition of new function types.

  • Property svn:keywords set to Id
Line 
1#!/usr/bin/env python
2"""NDG XACML functions unit tests
3
4NERC DataGrid
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 functions implementation
24   
25    The log output gives an indication of the XACML functions which are not
26    implemented yet"""
27   
28    def test01LoadMap(self):   
29        funcMap = FunctionMap()
30        funcMap.loadAllCore()
31        anyUriMatchNs = \
32            'urn:oasis:names:tc:xacml:2.0:function:anyURI-regexp-match'
33           
34        self.assert_(issubclass(funcMap.get(anyUriMatchNs), RegexpMatchBase))
35
36       
37if __name__ == "__main__":
38    unittest.main()
Note: See TracBrowser for help on using the repository browser.