Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg-security/TI12-security/trunk/ndg_xacml/ndg/xacml/test/test_functions.py@7682
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 | |
---|
4 | NERC 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$" |
---|
13 | import unittest |
---|
14 | from os import path |
---|
15 | import logging |
---|
16 | logging.basicConfig(level=logging.DEBUG) |
---|
17 | |
---|
18 | from ndg.xacml.core.functions import FunctionMap |
---|
19 | from ndg.xacml.core.functions.v2.regexp_match import RegexpMatchBase |
---|
20 | |
---|
21 | |
---|
22 | class 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 | |
---|
37 | if __name__ == "__main__": |
---|
38 | unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.