1
2 """NDG XACML Context 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: test_context.py 7955 2011-12-21 18:29:45Z rwilkinson $"
13 import unittest
14 import logging
15 logging.basicConfig(level=logging.DEBUG)
16
17 from ndg.xacml.core.context.pdpinterface import PDPInterface
18 from ndg.xacml.core.context.pdp import PDP
19 from ndg.xacml.core.context.handler import CtxHandlerInterface
20 from ndg.xacml.core.context.response import Response
21 from ndg.xacml.core.context.result import Result, Decision
22 from ndg.xacml.test.context import XacmlContextBaseTestCase, TestContextHandler
23
24
25 -class XacmlContextTestCase(XacmlContextBaseTestCase):
26 """Test PDP, PAP, PIP and Context handler"""
27
29 requestCtx = self._createRequestCtx("http://localhost")
30 self.assert_(requestCtx)
31
38
40 self.assertRaises(TypeError, CtxHandlerInterface,
41 "Context handler is an abstract base class")
42
45
47 self.assertRaises(TypeError, PDPInterface)
48
50 pdp = PDP()
51 self.assert_(pdp)
52
56
57
58 if __name__ == "__main__":
59 unittest.main()
60