5
:Contact: goodger@users.sourceforge.net
6
:Revision: $Revision: 1.2 $
7
:Date: $Date: 2002/04/25 03:43:45 $
8
:Copyright: This module has been placed in the public domain.
13
from __init__ import DocutilsTestSupport
16
s = DocutilsTestSupport.ParserTestSuite()
17
s.generateTests(totest)
22
totest['section_headers'] = [
31
<section id="title" name="title">
40
Paragraph (no blank line).
44
<section id="title" name="title">
48
Paragraph (no blank line).
62
<section id="title" name="title">
69
Test unexpected section titles.
83
Test unexpected section titles.
85
<system_message level="4" type="SEVERE">
87
Unexpected section title at line 4.
93
<system_message level="4" type="SEVERE">
95
Unexpected section title or transition at line 7.
98
<system_message level="4" type="SEVERE">
100
Unexpected section title at line 9.
111
Test short underline.
115
<system_message level="1" type="INFO">
117
Title underline too short at line 2.
121
<section id="title" name="title">
125
Test short underline.
136
<section id="title" name="title">
147
Test overline title with inset.
151
<section id="title" name="title">
155
Test overline title with inset.
158
========================
159
Test Missing Underline
163
<system_message level="4" type="SEVERE">
165
Incomplete section title at line 1.
167
========================
168
Test Missing Underline
171
========================
172
Test Missing Underline
177
<system_message level="4" type="SEVERE">
179
Missing underline for overline at line 1.
181
========================
182
Test Missing Underline
188
Test missing underline, with paragraph.
192
<system_message level="4" type="SEVERE">
194
Missing underline for overline at line 1.
199
Test missing underline, with paragraph.
206
Test long title and space normalization.
210
<system_message level="1" type="INFO">
212
Title overline too short at line 1.
217
<section id="long-title" name="long title">
221
Test long title and space normalization.
232
<system_message level="4" type="SEVERE">
234
Title overline & underline mismatch at line 1.
243
========================
245
========================
247
Test missing titles; blank line in-between.
249
========================
251
========================
255
<system_message level="3" type="ERROR">
257
Document or section may not begin with a transition (line 1).
259
<system_message level="3" type="ERROR">
261
At least one body element must separate transitions; adjacent transitions at line 3.
264
Test missing titles; blank line in-between.
267
<system_message level="3" type="ERROR">
269
Document or section may not end with a transition (line 9).
272
========================
273
========================
275
Test missing titles; nothing in-between.
277
========================
278
========================
282
<system_message level="3" type="ERROR">
284
Invalid section title or transition marker at line 1.
286
========================
287
========================
289
Test missing titles; nothing in-between.
290
<system_message level="3" type="ERROR">
292
Invalid section title or transition marker at line 6.
294
========================
295
========================
298
.. Test return to existing, highest-level section (Title 3).
319
Test return to existing, highest-level section (Title 3).
320
<section id="title-1" name="title 1">
325
<section id="title-2" name="title 2">
330
<section id="title-3" name="title 3">
335
<section id="title-4" name="title 4">
342
Test return to existing, highest-level section (Title 3, with overlines).
367
Test return to existing, highest-level section (Title 3, with overlines).
368
<section id="title-1" name="title 1">
373
<section id="title-2" name="title 2">
378
<section id="title-3" name="title 3">
383
<section id="title-4" name="title 4">
390
Test return to existing, higher-level section (Title 4).
411
Test return to existing, higher-level section (Title 4).
412
<section id="title-1" name="title 1">
417
<section id="title-2" name="title 2">
422
<section id="title-3" name="title 3">
427
<section id="title-4" name="title 4">
434
Test bad subsection order (Title 4).
455
Test bad subsection order (Title 4).
456
<section id="title-1" name="title 1">
461
<section id="title-2" name="title 2">
466
<section id="title-3" name="title 3">
471
<system_message level="4" type="SEVERE">
473
Title level inconsistent at line 15:
481
Test bad subsection order (Title 4, with overlines).
506
Test bad subsection order (Title 4, with overlines).
507
<section id="title-1" name="title 1">
512
<section id="title-2" name="title 2">
517
<section id="title-3" name="title 3">
522
<system_message level="4" type="SEVERE">
524
Title level inconsistent at line 19:
533
Title containing *inline* ``markup``
534
====================================
540
<section id="title-containing-inline-markup" name="title containing inline markup">
553
if __name__ == '__main__':
555
unittest.main(defaultTest='suite')