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_compound.py
blobc27030fb0a925c7d495d21d400b740797bef6e59
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 'compound' directive from body.py.
9 """
11 from __init__ import DocutilsTestSupport
13 def suite():
14 s = DocutilsTestSupport.ParserTestSuite()
15 s.generateTests(totest)
16 return s
18 totest = {}
20 totest['compound'] = [
21 ["""\
22 .. compound::
24 Compound paragraphs are single logical paragraphs
25 which contain embedded
27 * lists
28 * tables
29 * literal blocks
30 * and other body elements
32 and are split into multiple physical paragraphs.
33 """,
34 """\
35 <document source="test data">
36 <compound>
37 <paragraph>
38 Compound paragraphs are single logical paragraphs
39 which contain embedded
40 <bullet_list bullet="*">
41 <list_item>
42 <paragraph>
43 lists
44 <list_item>
45 <paragraph>
46 tables
47 <list_item>
48 <paragraph>
49 literal blocks
50 <list_item>
51 <paragraph>
52 and other body elements
53 <paragraph>
54 and are split into multiple physical paragraphs.
55 """],
56 ["""\
57 .. compound::
58 :name: interesting
59 :class: log
61 This is an extremely interesting compound paragraph containing a
62 simple paragraph, a literal block with some useless log messages::
64 Connecting... OK
65 Transmitting data... OK
66 Disconnecting... OK
68 and another simple paragraph which is actually just a continuation
69 of the first simple paragraph, with the literal block in between.
70 """,
71 """\
72 <document source="test data">
73 <compound classes="log" ids="interesting" names="interesting">
74 <paragraph>
75 This is an extremely interesting compound paragraph containing a
76 simple paragraph, a literal block with some useless log messages:
77 <literal_block xml:space="preserve">
78 Connecting... OK
79 Transmitting data... OK
80 Disconnecting... OK
81 <paragraph>
82 and another simple paragraph which is actually just a continuation
83 of the first simple paragraph, with the literal block in between.
84 """],
85 ["""\
86 .. compound:: content may start on same line
88 second paragraph
89 """,
90 """\
91 <document source="test data">
92 <compound>
93 <paragraph>
94 content may start on same line
95 <paragraph>
96 second paragraph
97 """],
101 if __name__ == '__main__':
102 import unittest
103 unittest.main(defaultTest='suite')