| | 977 | def test_match_multiple_times1(self): |
| | 978 | # See http://genshi.edgewall.org/ticket/370 |
| | 979 | tmpl = MarkupTemplate("""<html xmlns:py="http://genshi.edgewall.org/"> |
| | 980 | <py:match path="body[@id='content']/h2" /> |
| | 981 | <head py:match="head" /> |
| | 982 | <head py:match="head" /> |
| | 983 | <head /> |
| | 984 | <body /> |
| | 985 | </html>""") |
| | 986 | self.assertEqual("""<html> |
| | 987 | <head/> |
| | 988 | <body/> |
| | 989 | </html>""", tmpl.generate().render()) |
| | 990 | |
| | 991 | def test_match_multiple_times2(self): |
| | 992 | # See http://genshi.edgewall.org/ticket/370 |
| | 993 | tmpl = MarkupTemplate("""<html xmlns:py="http://genshi.edgewall.org/"> |
| | 994 | <py:match path="body/div[@id='properties']" /> |
| | 995 | <head py:match="head" /> |
| | 996 | <head py:match="head" /> |
| | 997 | <head/> |
| | 998 | <body> |
| | 999 | <div id="properties">Foo</div> |
| | 1000 | </body> |
| | 1001 | </html>""") |
| | 1002 | self.assertEqual("""<html> |
| | 1003 | <head/> |
| | 1004 | <body> |
| | 1005 | </body> |
| | 1006 | </html>""", tmpl.generate().render()) |
| | 1007 | |