comparison genshi/template/tests/markup.py @ 703:af57b12e3dd2 experimental-match-fastpaths

merge in trunk up through r818 - fundamentally changed the way MatchSet works, but actually is more consistent now
author aflett
date Mon, 31 Mar 2008 22:47:50 +0000
parents f3bc1de7138d
children fc6d9d2a3527 d143dd73789b
comparison
equal deleted inserted replaced
701:52a597419c0d 703:af57b12e3dd2
609 <body> 609 <body>
610 wakka wakka wakka 610 wakka wakka wakka
611 </body> 611 </body>
612 </html>""", tmpl.generate().render()) 612 </html>""", tmpl.generate().render())
613 613
614 def test_with_in_match(self):
615 xml = ("""<html xmlns:py="http://genshi.edgewall.org/">
616 <py:match path="body/p">
617 <h1>${select('text()')}</h1>
618 ${select('.')}
619 </py:match>
620 <body><p py:with="foo='bar'">${foo}</p></body>
621 </html>""")
622 tmpl = MarkupTemplate(xml, filename='test.html')
623 self.assertEqual("""<html>
624 <body>
625 <h1>bar</h1>
626 <p>bar</p>
627 </body>
628 </html>""", tmpl.generate().render())
629
614 def test_nested_include_matches(self): 630 def test_nested_include_matches(self):
615 # See ticket #157 631 # See ticket #157
616 dirname = tempfile.mkdtemp(suffix='genshi_test') 632 dirname = tempfile.mkdtemp(suffix='genshi_test')
617 try: 633 try:
618 file1 = open(os.path.join(dirname, 'tmpl1.html'), 'w') 634 file1 = open(os.path.join(dirname, 'tmpl1.html'), 'w')
Copyright (C) 2012-2017 Edgewall Software