annotate markup/tests/output.py @ 164:1f6cb675a66c trunk

Report error when position predicates are used in XPath expressions (which is NYI).
author cmlenz
date Wed, 16 Aug 2006 23:06:32 +0000
parents d19e8a2c549e
children 553866249cb0
rev   line source
1
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
1 # -*- coding: utf-8 -*-
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
2 #
66
59eb24184e9c Switch copyright to Edgewall and URLs to markup.edgewall.org.
cmlenz
parents: 27
diff changeset
3 # Copyright (C) 2006 Edgewall Software
1
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
4 # All rights reserved.
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
5 #
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
6 # This software is licensed as described in the file COPYING, which
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
7 # you should have received as part of this distribution. The terms
66
59eb24184e9c Switch copyright to Edgewall and URLs to markup.edgewall.org.
cmlenz
parents: 27
diff changeset
8 # are also available at http://markup.edgewall.org/wiki/License.
1
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
9 #
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
10 # This software consists of voluntary contributions made by many
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
11 # individuals. For the exact contribution history, see the revision
66
59eb24184e9c Switch copyright to Edgewall and URLs to markup.edgewall.org.
cmlenz
parents: 27
diff changeset
12 # history and logs, available at http://markup.edgewall.org/log/.
1
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
13
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
14 import doctest
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
15 import unittest
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
16 import sys
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
17
85
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
18 from markup.core import Stream
141
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
19 from markup.input import HTML, XML
123
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
20 from markup.output import DocType, XMLSerializer, XHTMLSerializer, \
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
21 HTMLSerializer
85
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
22
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
23
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
24 class XMLSerializerTestCase(unittest.TestCase):
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
25
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
26 def test_doctype_in_stream(self):
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
27 stream = Stream([(Stream.DOCTYPE, DocType.HTML_STRICT, ('?', -1, -1))])
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
28 output = stream.render(XMLSerializer)
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
29 self.assertEqual('<!DOCTYPE html PUBLIC '
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
30 '"-//W3C//DTD HTML 4.01//EN" '
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
31 '"http://www.w3.org/TR/html4/strict.dtd">\n',
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
32 output)
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
33
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
34 def test_doctype_in_stream_no_sysid(self):
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
35 stream = Stream([(Stream.DOCTYPE,
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
36 ('html', '-//W3C//DTD HTML 4.01//EN', None),
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
37 ('?', -1, -1))])
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
38 output = stream.render(XMLSerializer)
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
39 self.assertEqual('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">\n',
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
40 output)
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
41
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
42 def test_doctype_in_stream_no_pubid(self):
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
43 stream = Stream([(Stream.DOCTYPE,
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
44 ('html', None, 'http://www.w3.org/TR/html4/strict.dtd'),
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
45 ('?', -1, -1))])
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
46 output = stream.render(XMLSerializer)
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
47 self.assertEqual('<!DOCTYPE html SYSTEM '
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
48 '"http://www.w3.org/TR/html4/strict.dtd">\n',
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
49 output)
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
50
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
51 def test_doctype_in_stream_no_pubid_or_sysid(self):
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
52 stream = Stream([(Stream.DOCTYPE, ('html', None, None),
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
53 ('?', -1, -1))])
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
54 output = stream.render(XMLSerializer)
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
55 self.assertEqual('<!DOCTYPE html>\n', output)
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
56
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
57 def test_serializer_doctype(self):
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
58 stream = Stream([])
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
59 output = stream.render(XMLSerializer, doctype=DocType.HTML_STRICT)
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
60 self.assertEqual('<!DOCTYPE html PUBLIC '
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
61 '"-//W3C//DTD HTML 4.01//EN" '
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
62 '"http://www.w3.org/TR/html4/strict.dtd">\n',
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
63 output)
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
64
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
65 def test_doctype_one_and_only(self):
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
66 stream = Stream([(Stream.DOCTYPE, ('html', None, None), ('?', -1, -1))])
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
67 output = stream.render(XMLSerializer, doctype=DocType.HTML_STRICT)
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
68 self.assertEqual('<!DOCTYPE html PUBLIC '
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
69 '"-//W3C//DTD HTML 4.01//EN" '
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
70 '"http://www.w3.org/TR/html4/strict.dtd">\n',
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
71 output)
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
72
89
80386d62814f Support comments in templates that are not included in the output, in the same way Kid does: if the comment text starts with a `!` character, it is stripped from the output.
cmlenz
parents: 85
diff changeset
73 def test_comment(self):
80386d62814f Support comments in templates that are not included in the output, in the same way Kid does: if the comment text starts with a `!` character, it is stripped from the output.
cmlenz
parents: 85
diff changeset
74 stream = Stream([(Stream.COMMENT, 'foo bar', ('?', -1, -1))])
80386d62814f Support comments in templates that are not included in the output, in the same way Kid does: if the comment text starts with a `!` character, it is stripped from the output.
cmlenz
parents: 85
diff changeset
75 output = stream.render(XMLSerializer)
80386d62814f Support comments in templates that are not included in the output, in the same way Kid does: if the comment text starts with a `!` character, it is stripped from the output.
cmlenz
parents: 85
diff changeset
76 self.assertEqual('<!--foo bar-->', output)
80386d62814f Support comments in templates that are not included in the output, in the same way Kid does: if the comment text starts with a `!` character, it is stripped from the output.
cmlenz
parents: 85
diff changeset
77
105
71f3db26eecb Include processing instructions in serialized streams.
cmlenz
parents: 89
diff changeset
78 def test_processing_instruction(self):
71f3db26eecb Include processing instructions in serialized streams.
cmlenz
parents: 89
diff changeset
79 stream = Stream([(Stream.PI, ('python', 'x = 2'), ('?', -1, -1))])
71f3db26eecb Include processing instructions in serialized streams.
cmlenz
parents: 89
diff changeset
80 output = stream.render(XMLSerializer)
71f3db26eecb Include processing instructions in serialized streams.
cmlenz
parents: 89
diff changeset
81 self.assertEqual('<?python x = 2?>', output)
71f3db26eecb Include processing instructions in serialized streams.
cmlenz
parents: 89
diff changeset
82
1
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
83
123
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
84 class XHTMLSerializerTestCase(unittest.TestCase):
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
85
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
86 def test_textarea_whitespace(self):
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
87 content = '\nHey there. \n\n I am indented.\n'
141
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
88 stream = XML('<textarea name="foo">%s</textarea>' % content)
123
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
89 output = stream.render(XHTMLSerializer)
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
90 self.assertEqual('<textarea name="foo">%s</textarea>' % content, output)
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
91
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
92 def test_xml_space(self):
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
93 text = '<foo xml:space="preserve"> Do not mess \n\n with me </foo>'
141
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
94 output = XML(text).render(XHTMLSerializer)
123
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
95 self.assertEqual(text, output)
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
96
141
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
97 def test_script_escaping(self):
143
3d4c214c979a CDATA sections in XML input now appear as CDATA sections in the output. This should address the problem with escaping the contents of `<style>` and `<script>` elements, which would only get interpreted correctly if the output was served as `application/xhtml+xml`. Closes #24.
cmlenz
parents: 141
diff changeset
98 text = """<script>/*<![CDATA[*/
3d4c214c979a CDATA sections in XML input now appear as CDATA sections in the output. This should address the problem with escaping the contents of `<style>` and `<script>` elements, which would only get interpreted correctly if the output was served as `application/xhtml+xml`. Closes #24.
cmlenz
parents: 141
diff changeset
99 if (1 < 2) { alert("Doh"); }
3d4c214c979a CDATA sections in XML input now appear as CDATA sections in the output. This should address the problem with escaping the contents of `<style>` and `<script>` elements, which would only get interpreted correctly if the output was served as `application/xhtml+xml`. Closes #24.
cmlenz
parents: 141
diff changeset
100 /*]]>*/</script>"""
141
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
101 output = XML(text).render(XHTMLSerializer)
143
3d4c214c979a CDATA sections in XML input now appear as CDATA sections in the output. This should address the problem with escaping the contents of `<style>` and `<script>` elements, which would only get interpreted correctly if the output was served as `application/xhtml+xml`. Closes #24.
cmlenz
parents: 141
diff changeset
102 self.assertEqual(text, output)
141
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
103
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
104 def test_style_escaping(self):
143
3d4c214c979a CDATA sections in XML input now appear as CDATA sections in the output. This should address the problem with escaping the contents of `<style>` and `<script>` elements, which would only get interpreted correctly if the output was served as `application/xhtml+xml`. Closes #24.
cmlenz
parents: 141
diff changeset
105 text = """<style>/*<![CDATA[*/
3d4c214c979a CDATA sections in XML input now appear as CDATA sections in the output. This should address the problem with escaping the contents of `<style>` and `<script>` elements, which would only get interpreted correctly if the output was served as `application/xhtml+xml`. Closes #24.
cmlenz
parents: 141
diff changeset
106 html > body { display: none; }
3d4c214c979a CDATA sections in XML input now appear as CDATA sections in the output. This should address the problem with escaping the contents of `<style>` and `<script>` elements, which would only get interpreted correctly if the output was served as `application/xhtml+xml`. Closes #24.
cmlenz
parents: 141
diff changeset
107 /*]]>*/</style>"""
141
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
108 output = XML(text).render(XHTMLSerializer)
143
3d4c214c979a CDATA sections in XML input now appear as CDATA sections in the output. This should address the problem with escaping the contents of `<style>` and `<script>` elements, which would only get interpreted correctly if the output was served as `application/xhtml+xml`. Closes #24.
cmlenz
parents: 141
diff changeset
109 self.assertEqual(text, output)
141
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
110
158
3f23fafeef99 * Add test case for SVG content embedded in an HTML document.
cmlenz
parents: 143
diff changeset
111 def test_embedded_svg(self):
3f23fafeef99 * Add test case for SVG content embedded in an HTML document.
cmlenz
parents: 143
diff changeset
112 text = """<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg">
3f23fafeef99 * Add test case for SVG content embedded in an HTML document.
cmlenz
parents: 143
diff changeset
113 <body>
3f23fafeef99 * Add test case for SVG content embedded in an HTML document.
cmlenz
parents: 143
diff changeset
114 <button>
3f23fafeef99 * Add test case for SVG content embedded in an HTML document.
cmlenz
parents: 143
diff changeset
115 <svg:svg width="600px" height="400px">
160
d19e8a2c549e Attribute order in parsed XML is now preserved.
cmlenz
parents: 158
diff changeset
116 <svg:polygon id="triangle" points="50,50 50,300 300,300" />
158
3f23fafeef99 * Add test case for SVG content embedded in an HTML document.
cmlenz
parents: 143
diff changeset
117 </svg:svg>
3f23fafeef99 * Add test case for SVG content embedded in an HTML document.
cmlenz
parents: 143
diff changeset
118 </button>
3f23fafeef99 * Add test case for SVG content embedded in an HTML document.
cmlenz
parents: 143
diff changeset
119 </body>
3f23fafeef99 * Add test case for SVG content embedded in an HTML document.
cmlenz
parents: 143
diff changeset
120 </html>"""
3f23fafeef99 * Add test case for SVG content embedded in an HTML document.
cmlenz
parents: 143
diff changeset
121 output = XML(text).render(XHTMLSerializer)
3f23fafeef99 * Add test case for SVG content embedded in an HTML document.
cmlenz
parents: 143
diff changeset
122 self.assertEqual(text, output)
3f23fafeef99 * Add test case for SVG content embedded in an HTML document.
cmlenz
parents: 143
diff changeset
123
123
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
124
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
125 class HTMLSerializerTestCase(unittest.TestCase):
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
126
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
127 def test_xml_space(self):
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
128 text = '<foo xml:space="preserve"> Do not mess \n\n with me </foo>'
141
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
129 output = XML(text).render(HTMLSerializer)
123
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
130 self.assertEqual('<foo> Do not mess \n\n with me </foo>', output)
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
131
141
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
132 def test_script_escaping(self):
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
133 text = '<script>if (1 &lt; 2) { alert("Doh"); }</script>'
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
134 output = XML(text).render(HTMLSerializer)
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
135 self.assertEqual('<script>if (1 < 2) { alert("Doh"); }</script>',
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
136 output)
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
137
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
138 def test_style_escaping(self):
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
139 text = '<style>html &gt; body { display: none; }</style>'
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
140 output = XML(text).render(HTMLSerializer)
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
141 self.assertEqual('<style>html > body { display: none; }</style>',
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
142 output)
520a5b7dd6d2 * No escaping of `<script>` or `<style>` tags in HTML output (see #24)
cmlenz
parents: 123
diff changeset
143
123
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
144
1
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
145 def suite():
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
146 suite = unittest.TestSuite()
85
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
147 suite.addTest(unittest.makeSuite(XMLSerializerTestCase, 'test'))
123
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
148 suite.addTest(unittest.makeSuite(XHTMLSerializerTestCase, 'test'))
10279d2eeec9 Fix for #18: whitespace in space-sensitive elements such as `<pre>` and `<textarea>` is now preserved.
cmlenz
parents: 105
diff changeset
149 suite.addTest(unittest.makeSuite(HTMLSerializerTestCase, 'test'))
85
4938c310d904 Improve handling of DOCTYPE declarations.
cmlenz
parents: 66
diff changeset
150 suite.addTest(doctest.DocTestSuite(XMLSerializer.__module__))
1
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
151 return suite
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
152
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
153 if __name__ == '__main__':
5479aae32f5a Initial import.
cmlenz
parents:
diff changeset
154 unittest.main(defaultTest='suite')
Copyright (C) 2012-2017 Edgewall Software