diff genshi/template/tests/markup.py @ 924:3c09c8d8a578

Pull up r1146 to trunk. Addresses #399
author jruigrok
date Mon, 13 Dec 2010 19:07:59 +0000
parents 6638c9db9e8c
children 705727288d7e
line wrap: on
line diff
--- a/genshi/template/tests/markup.py
+++ b/genshi/template/tests/markup.py
@@ -732,6 +732,30 @@
             </body>
         </html>""", tmpl.generate().render(encoding=None))
 
+    def test_match_tail_handling(self): 
+        # See <http://genshi.edgewall.org/ticket/399> 
+        xml = ("""<rhyme xmlns:py="http://genshi.edgewall.org/">
+          <py:match path="*[@type]">
+            ${select('.')}
+          </py:match>
+
+          <lines>
+            <first type="one">fish</first>
+            <second type="two">fish</second>
+            <third type="red">fish</third>
+            <fourth type="blue">fish</fourth>
+          </lines>
+        </rhyme>""") 
+        tmpl = MarkupTemplate(xml, filename='test.html') 
+        self.assertEqual("""<rhyme>
+          <lines>
+            <first type="one">fish</first>
+            <second type="two">fish</second>
+            <third type="red">fish</third>
+            <fourth type="blue">fish</fourth>
+          </lines>
+        </rhyme>""", tmpl.generate().render(encoding=None)) 
+
 
 def suite():
     suite = unittest.TestSuite()
Copyright (C) 2012-2017 Edgewall Software