4 # Author: David Goodger <goodger@python.org>
5 # Copyright: This module has been placed in the public domain.
8 Tests for admonitions.py directives.
11 from __init__
import DocutilsTestSupport
14 s
= DocutilsTestSupport
.ParserTestSuite()
15 s
.generateTests(totest
)
20 totest
['admonitions'] = [
22 .. Attention:: Directives at large.
24 .. Note:: :name: mynote
27 Admonitions support the generic "name" and "class" options.
32 .. Hint:: It's bigger than a bread box.
34 - .. WARNING:: Strong prose may provoke extreme mental exertion.
35 Reader discretion is strongly advised.
36 - .. Error:: Does not compute.
40 Don't take any wooden nickels.
42 .. DANGER:: Mad scientist at work!
45 - Wash behind your ears.
51 <document source="test data">
55 <note classes="testnote" ids="mynote" names="mynote">
57 Admonitions support the generic "name" and "class" options.
64 It's bigger than a bread box.
65 <bullet_list bullet="-">
69 Strong prose may provoke extreme mental exertion.
70 Reader discretion is strongly advised.
77 Don't take any wooden nickels.
80 Mad scientist at work!
82 <bullet_list bullet="-">
85 Wash behind your ears.
97 .. note:: One-line notes.
98 .. note:: One after the other.
99 .. note:: No blank lines in-between.
102 <document source="test data">
111 No blank lines in-between.
117 <document source="test data">
118 <system_message level="3" line="1" source="test data" type="ERROR">
120 Content block expected for the "note" directive; none found.
121 <literal_block xml:space="preserve">
125 .. admonition:: Admonition
127 This is a generic admonition.
130 <document source="test data">
131 <admonition classes="admonition-admonition">
135 This is a generic admonition.
138 .. admonition:: And, by the way...
140 You can make up your own admonition too.
143 <document source="test data">
144 <admonition classes="admonition-and-by-the-way">
148 You can make up your own admonition too.
151 .. admonition:: Admonition
153 :name: reference name
155 Test the "class" override.
158 <document source="test data">
159 <admonition classes="emergency" ids="reference-name" names="reference\ name">
163 Test the "class" override.
168 Generic admonitions require a title.
171 <document source="test data">
172 <system_message level="3" line="1" source="test data" type="ERROR">
174 Error in "admonition" directive:
175 1 argument(s) required, 0 supplied.
176 <literal_block xml:space="preserve">
179 Generic admonitions require a title.
184 if __name__
== '__main__':
186 unittest
.main(defaultTest
='suite')