diff options
author | scoder <none@none> | 2008-03-03 19:41:59 +0100 |
---|---|---|
committer | scoder <none@none> | 2008-03-03 19:41:59 +0100 |
commit | 705f970079e3fd1b0ef81d7426bb85b82cd2a324 (patch) | |
tree | 002f80f9e4a4afeba389d71c34bcdf1b3d3856a0 /src/lxml/tests/test_xslt.py | |
parent | 988086b5ebb47899e9652b2129f19ec87a6ccabc (diff) | |
download | python-lxml-705f970079e3fd1b0ef81d7426bb85b82cd2a324.tar.gz |
[svn r3386] r3698@delle: sbehnel | 2008-03-03 11:49:57 +0100
constant instances DENY_ALL/DENY_WRITE on XSLTAccessControl class
--HG--
branch : trunk
Diffstat (limited to 'src/lxml/tests/test_xslt.py')
-rw-r--r-- | src/lxml/tests/test_xslt.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/lxml/tests/test_xslt.py b/src/lxml/tests/test_xslt.py index 44d9539b..ff559c8b 100644 --- a/src/lxml/tests/test_xslt.py +++ b/src/lxml/tests/test_xslt.py @@ -819,6 +819,29 @@ class ETreeXSLTTestCase(HelperTestCase): self.assertEquals(root[3].get("value"), 'B') + def test_xslt_document_parse_allow(self): + access_control = etree.XSLTAccessControl(read_file=True) + xslt = etree.XSLT(etree.parse(fileInTestDir("test-document.xslt")), + access_control = access_control) + result = xslt(etree.XML('<a/>')) + root = result.getroot() + self.assertEquals(root.tag, + 'test') + self.assertEquals(root[0].tag, + '{http://www.w3.org/1999/XSL/Transform}stylesheet') + + def test_xslt_document_parse_deny(self): + access_control = etree.XSLTAccessControl(read_file=False) + xslt = etree.XSLT(etree.parse(fileInTestDir("test-document.xslt")), + access_control = access_control) + self.assertRaises(etree.XSLTApplyError, xslt, etree.XML('<a/>')) + + def test_xslt_document_parse_deny_all(self): + access_control = etree.XSLTAccessControl.DENY_ALL + xslt = etree.XSLT(etree.parse(fileInTestDir("test-document.xslt")), + access_control = access_control) + self.assertRaises(etree.XSLTApplyError, xslt, etree.XML('<a/>')) + def test_xslt_move_result(self): root = etree.XML('''\ <transform> |