comparison 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
comparison
equal deleted inserted replaced
923:8cef75b02ac1 924:3c09c8d8a578
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