[Lxml-checkins] r53720 - in lxml/trunk: . src/lxml/tests

scoder at codespeak.net scoder at codespeak.net
Sat Apr 12 14:33:47 CEST 2008


Author: scoder
Date: Sat Apr 12 14:33:47 2008
New Revision: 53720

Modified:
   lxml/trunk/   (props changed)
   lxml/trunk/src/lxml/tests/test_xslt.py
Log:
 r3947 at delle:  sbehnel | 2008-04-12 12:11:43 +0200
 test case for currently lacking XSLT error on wrong stylesheet parameters


Modified: lxml/trunk/src/lxml/tests/test_xslt.py
==============================================================================
--- lxml/trunk/src/lxml/tests/test_xslt.py	(original)
+++ lxml/trunk/src/lxml/tests/test_xslt.py	Sat Apr 12 14:33:47 2008
@@ -299,6 +299,24 @@
 ''',
                           str(res))
 
+    def _test_xslt_parameter_invalid(self):
+        tree = self.parse('<a><b>B</b><c>C</c></a>')
+        style = self.parse('''\
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  <xsl:template match="/">
+    <foo><xsl:value-of select="$bar" /></foo>
+  </xsl:template>
+</xsl:stylesheet>''')
+
+        st = etree.XSLT(style)
+        res = self.assertRaises(etree.XSLTApplyError,
+                                st, tree, bar="test")
+        res = self.assertRaises(etree.XSLTApplyError,
+                                st, tree, bar="<test/>")
+        res = self.assertRaises(etree.XSLTApplyError,
+                                st, tree, bar="....")
+
     if etree.LIBXSLT_VERSION < (1,1,18):
         # later versions produce no error
         def test_xslt_parameter_missing(self):


More information about the lxml-checkins mailing list