| 1 | #!/usr/bin/env python |
|---|
| 2 | |
|---|
| 3 | import unittest |
|---|
| 4 | import re |
|---|
| 5 | |
|---|
| 6 | from genshi.template import MarkupTemplate |
|---|
| 7 | |
|---|
| 8 | tmpl_data="""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|---|
| 9 | <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/"> |
|---|
| 10 | |
|---|
| 11 | <py:match path="body[@id='content']/h2" /> |
|---|
| 12 | <head py:match="head" /> |
|---|
| 13 | <head py:match="head" /> |
|---|
| 14 | |
|---|
| 15 | <head /> |
|---|
| 16 | <body /> |
|---|
| 17 | </html> |
|---|
| 18 | """ |
|---|
| 19 | |
|---|
| 20 | class TestExceptionWithMultipleMatches(unittest.TestCase): |
|---|
| 21 | def test_no_match(self): |
|---|
| 22 | tmpl = MarkupTemplate(tmpl_data) |
|---|
| 23 | tmpl.generate().render('xhtml', doctype='xhtml') |
|---|
| 24 | |
|---|
| 25 | |
|---|