Edgewall Software

Ticket #370: pymatch_regression.py

File pymatch_regression.py, 630 bytes (added by Felix Schwarz <felix.schwarz@…>, 14 years ago)

Testcase

Line 
1#!/usr/bin/env python
2
3import unittest
4import re
5
6from genshi.template import MarkupTemplate
7
8tmpl_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
20class TestExceptionWithMultipleMatches(unittest.TestCase):
21    def test_no_match(self):
22        tmpl = MarkupTemplate(tmpl_data)
23        tmpl.generate().render('xhtml', doctype='xhtml')
24
25