@@ -21,14 +21,16 @@ class Xhtml5Test(unittest.TestCase):
2121
2222def assertXmlEquals (self ,input ,expected = None ,parser = XMLParser ):
2323document = parser (tree = dom .TreeBuilder ).parse (input ).documentElement
24+ #print document.toxml('utf-8')
2425if not expected :
2526expected = xmlelem .sub (sortattrs ,input )
2627expected = re .sub ('&#(\d+);' ,ncr ,expected )
2728output = xmlelem .sub (sortattrs ,document .toxml ('utf-8' ))
2829self .assertEquals (expected ,output )
2930else :
30- self .assertEquals (expected ,document .toxml ('utf-8' ))
31-
31+ self .assertEquals (expected ,document .toxml ('utf-8' ))
32+ pass
33+
3234def assertXhtmlEquals (self ,input ,expected = None ,parser = XHTMLParser ):
3335self .assertXmlEquals (input ,expected ,parser )
3436
@@ -93,8 +95,7 @@ def test_malformed(self):
9395class XhtmlTest (Xhtml5Test ):
9496
9597def test_mathml (self ):
96- self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml">
97- <head><title>MathML</title></head>
98+ self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml"><head><title>MathML</title></head>
9899<body>
99100 <math xmlns="http://www.w3.org/1998/Math/MathML">
100101 <mrow>
@@ -140,8 +141,7 @@ def test_mathml(self):
140141</body></html>""" )
141142
142143def test_svg (self ):
143- self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml">
144- <head><title>SVG</title></head>
144+ self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml"><head><title>SVG</title></head>
145145<body>
146146 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
147147 <path d="M38,38c0-12,24-15,23-2c0,9-16,13-16,23v7h11v-4c0-9,17-12,17-27
@@ -154,8 +154,7 @@ def test_svg(self):
154154</body></html>""" )
155155
156156def test_xlink (self ):
157- self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml">
158- <head><title>XLINK</title></head>
157+ self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml"><head><title>XLINK</title></head>
159158<body>
160159 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
161160 <defs xmlns:l="http://www.w3.org/1999/xlink">
@@ -180,22 +179,19 @@ def test_xlink(self):
180179</body></html>""" )
181180
182181def test_br (self ):
183- self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml">
184- <head><title>BR</title></head>
182+ self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml"><head><title>BR</title></head>
185183<body>
186184<br/>
187185</body></html>""" )
188186
189187def test_strong (self ):
190- self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml">
191- <head><title>STRONG</title></head>
188+ self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml"><head><title>STRONG</title></head>
192189<body>
193190<strong></strong>
194191</body></html>""" )
195192
196193def test_script (self ):
197- self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml">
198- <head><title>SCRIPT</title></head>
194+ self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml"><head><title>SCRIPT</title></head>
199195<body>
200196<script>1 < 2 & 3</script>
201197</body></html>""" )
@@ -205,14 +201,12 @@ def test_script_src(self):
205201<head><title>SCRIPT</title><script src="http://example.com"/></head>
206202<body>
207203</body></html>""" ,
208- """<html xmlns="http://www.w3.org/1999/xhtml">
209- <head><title>SCRIPT</title><script src="http://example.com"></script></head>
204+ """<html xmlns="http://www.w3.org/1999/xhtml"><head><title>SCRIPT</title><script src="http://example.com"></script></head>
210205<body>
211206</body></html>""" )
212207
213208def test_title (self ):
214- self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml">
215- <head><title>1 < 2 & 3</title></head>
209+ self .assertXhtmlEquals ("""<html xmlns="http://www.w3.org/1999/xhtml"><head><title>1 < 2 & 3</title></head>
216210<body>
217211</body></html>""" )
218212
@@ -222,8 +216,7 @@ def test_prolog(self):
222216<head><title>PROLOG</title></head>
223217<body>
224218</body></html>""" ,
225- """<html xmlns="http://www.w3.org/1999/xhtml">
226- <head><title>PROLOG</title></head>
219+ """<html xmlns="http://www.w3.org/1999/xhtml"><head><title>PROLOG</title></head>
227220<body>
228221</body></html>""" )
229222
@@ -234,8 +227,7 @@ def test_tagsoup(self):
234227<body>
235228<u><blockquote><p></u>
236229</body></html>""" ,
237- """<html xmlns="http://www.w3.org/1999/xhtml">
238- <head><title>TAGSOUP</title></head>
230+ """<html xmlns="http://www.w3.org/1999/xhtml"><head><title>TAGSOUP</title></head>
239231<body>
240232<u/><blockquote><u/><p><u/>
241233</p></blockquote></body></html>""" )