comparison genshi/template/tests/markup.py @ 927:a1f3bbe1a680 stable-0.6.x

Merge r1149 from trunk (fix for tail selecting issue #399).
author hodgestar
date Thu, 10 Mar 2011 08:41:05 +0000
parents 6638c9db9e8c
children 705727288d7e
comparison
equal deleted inserted replaced
926:5dcabf565db1 927:a1f3bbe1a680
730 <body> 730 <body>
731 This replaces the other text. 731 This replaces the other text.
732 </body> 732 </body>
733 </html>""", tmpl.generate().render(encoding=None)) 733 </html>""", tmpl.generate().render(encoding=None))
734 734
735 def test_match_tail_handling(self):
736 # See <http://genshi.edgewall.org/ticket/399>
737 xml = ("""<rhyme xmlns:py="http://genshi.edgewall.org/">
738 <py:match path="*[@type]">
739 ${select('.')}
740 </py:match>
741
742 <lines>
743 <first type="one">fish</first>
744 <second type="two">fish</second>
745 <third type="red">fish</third>
746 <fourth type="blue">fish</fourth>
747 </lines>
748 </rhyme>""")
749 tmpl = MarkupTemplate(xml, filename='test.html')
750 self.assertEqual("""<rhyme>
751 <lines>
752 <first type="one">fish</first>
753 <second type="two">fish</second>
754 <third type="red">fish</third>
755 <fourth type="blue">fish</fourth>
756 </lines>
757 </rhyme>""", tmpl.generate().render(encoding=None))
758
735 759
736 def suite(): 760 def suite():
737 suite = unittest.TestSuite() 761 suite = unittest.TestSuite()
738 suite.addTest(doctest.DocTestSuite(MarkupTemplate.__module__)) 762 suite.addTest(doctest.DocTestSuite(MarkupTemplate.__module__))
739 suite.addTest(unittest.makeSuite(MarkupTemplateTestCase, 'test')) 763 suite.addTest(unittest.makeSuite(MarkupTemplateTestCase, 'test'))
Copyright (C) 2012-2017 Edgewall Software