Website: add template and basic stylesheet with menu. Update buildhtml.py (and theref...
[docutils.git] / sandbox / gitpull / web_stylesheet_and_menu / test / test_parsers / test_rst / test_directives / test_decorations.py
blobb0fec47d5438babf0d049ab2b46d5b48333859a4
1 #! /usr/bin/env python
3 # $Id$
4 # Author: David Goodger <goodger@python.org>
5 # Copyright: This module has been placed in the public domain.
7 """
8 Tests for the "header" & "footer" directives.
9 """
11 from __init__ import DocutilsTestSupport
13 def suite():
14 s = DocutilsTestSupport.ParserTestSuite()
15 s.generateTests(totest)
16 return s
18 totest = {}
20 totest['headers'] = [
21 ["""\
22 .. header:: a paragraph for the header
23 """,
24 """\
25 <document source="test data">
26 <decoration>
27 <header>
28 <paragraph>
29 a paragraph for the header
30 """],
31 ["""\
32 .. header::
33 """,
34 """\
35 <document source="test data">
36 <system_message level="3" line="1" source="test data" type="ERROR">
37 <paragraph>
38 Content block expected for the "header" directive; none found.
39 <literal_block xml:space="preserve">
40 .. header::
41 """],
42 ["""\
43 .. header:: first part of the header
44 .. header:: second part of the header
45 """,
46 """\
47 <document source="test data">
48 <decoration>
49 <header>
50 <paragraph>
51 first part of the header
52 <paragraph>
53 second part of the header
54 """],
57 totest['footers'] = [
58 ["""\
59 .. footer:: a paragraph for the footer
60 """,
61 """\
62 <document source="test data">
63 <decoration>
64 <footer>
65 <paragraph>
66 a paragraph for the footer
67 """],
68 ["""\
69 .. footer:: even if a footer is declared first
70 .. header:: the header appears first
71 """,
72 """\
73 <document source="test data">
74 <decoration>
75 <header>
76 <paragraph>
77 the header appears first
78 <footer>
79 <paragraph>
80 even if a footer is declared first
81 """],
85 if __name__ == '__main__':
86 import unittest
87 unittest.main(defaultTest='suite')