| 1 | #!/usr/bin/env python |
|---|
| 2 | |
|---|
| 3 | import unittest |
|---|
| 4 | import re |
|---|
| 5 | |
|---|
| 6 | from genshi.template import MarkupTemplate |
|---|
| 7 | |
|---|
| 8 | tmpl_data="""<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/"> |
|---|
| 9 | <py:match path="body/div[@id='properties']" /> |
|---|
| 10 | |
|---|
| 11 | <head py:match="head" /> |
|---|
| 12 | <head py:match="head" /> |
|---|
| 13 | <head/> |
|---|
| 14 | |
|---|
| 15 | <body> |
|---|
| 16 | <div id="properties">Foo</div> |
|---|
| 17 | </body> |
|---|
| 18 | </html> |
|---|
| 19 | """ |
|---|
| 20 | |
|---|
| 21 | class TestNoMatchWithMultipleMatchTemplates(unittest.TestCase): |
|---|
| 22 | def test_no_match(self): |
|---|
| 23 | tmpl = MarkupTemplate(tmpl_data) |
|---|
| 24 | html = tmpl.generate().render('xhtml', doctype='xhtml') |
|---|
| 25 | assert 'Foo' not in html, html |
|---|
| 26 | |
|---|
| 27 | |
|---|