3
# Author: reggie dugard
4
# Contact: reggie@users.sourceforge.net
5
# Revision: $Revision: 1.5 $
6
# Date: $Date: 2004/05/09 02:38:47 $
7
# Copyright: This module has been placed in the public domain.
10
Test for fragment code in HTML writer.
12
Note: the 'body' and 'whole' entries have been removed from the parts
13
dictionaries (redundant), along with 'meta' and 'stylesheet' entries with
14
standard values, and any entries with empty values.
17
from __init__ import DocutilsTestSupport
20
s = DocutilsTestSupport.HtmlPublishPartsTestSuite()
21
s.generateTests(totest)
27
totest['Title promotion'] = ({}, [
32
{'fragment': '''Simple String'''}
36
Simple String with *markup*
39
{'fragment': '''Simple String with <em>markup</em>'''}
43
Simple String with an even simpler ``inline literal``
46
{'fragment': '''Simple String with an even simpler <tt class="literal"><span class="pre">inline</span> <span class="pre">literal</span></tt>'''}
50
A simple `anonymous reference`__
52
__ http://www.test.com/test_url
55
{'fragment': '''<p>A simple <a class="reference" href="http://www.test.com/test_url">anonymous reference</a></p>\\n'''}
63
{'fragment': '''<p>One paragraph.</p>
64
<p>Two paragraphs.</p>\\n'''}
67
A simple `named reference`_ with stuff in between the
68
reference and the target.
70
.. _`named reference`: http://www.test.com/test_url
73
{'fragment': '''<p>A simple <a class="reference" href="http://www.test.com/test_url">named reference</a> with stuff in between the
74
reference and the target.</p>\\n'''}
97
{'fragment': '''<p>Some stuff</p>
98
<div class="section" id="section">
99
<h1><a name="section">Section</a></h1>
100
<p>Some more stuff</p>
101
<div class="section" id="another-section">
102
<h2><a name="another-section">Another Section</a></h2>
103
<p>And even more stuff</p>
106
'subtitle': '''Subtitle''',
107
'title': '''Title'''}
119
{'docinfo': '''<table class="docinfo" frame="void" rules="none">
120
<col class="docinfo-name" />
121
<col class="docinfo-content" />
123
<tr><th class="docinfo-name">Author:</th>
127
'fragment': '''<p>Some stuff</p>\\n''',
128
'meta': '''<meta name="author" content="me" />\\n''',
129
'title': '''Title'''}
133
totest['No title promotion'] = ({'doctitle_xform' : 0}, [
138
{'fragment': '''Simple String'''}
142
Simple String with *markup*
145
{'fragment': '''Simple String with <em>markup</em>'''}
149
Simple String with an even simpler ``inline literal``
152
{'fragment': '''Simple String with an even simpler <tt class="literal"><span class="pre">inline</span> <span class="pre">literal</span></tt>'''}
156
A simple `anonymous reference`__
158
__ http://www.test.com/test_url
161
{'fragment': '''<p>A simple <a class="reference" href="http://www.test.com/test_url">anonymous reference</a></p>\\n'''}
164
A simple `named reference`_ with stuff in between the
165
reference and the target.
167
.. _`named reference`: http://www.test.com/test_url
170
{'fragment': '''<p>A simple <a class="reference" href="http://www.test.com/test_url">named reference</a> with stuff in between the
171
reference and the target.</p>\\n'''}
194
{'fragment': '''<div class="section" id="title">
195
<h1><a name="title">Title</a></h1>
196
<div class="section" id="not-a-subtitle">
197
<h2><a name="not-a-subtitle">Not A Subtitle</a></h2>
199
<div class="section" id="section">
200
<h3><a name="section">Section</a></h3>
201
<p>Some more stuff</p>
202
<div class="section" id="another-section">
203
<h4><a name="another-section">Another Section</a></h4>
204
<p>And even more stuff</p>
213
if __name__ == '__main__':
215
unittest.main(defaultTest='suite')