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.
114 .. note:: Content before options
118 .. note:: :strong:`a role is not an option`.
119 :name: role not option
122 :strong:`not an option`, even if its starts a line.
125 <document source="test data">
126 <note classes="mynote">
128 Content before options
130 <note ids="role-not-option" names="role\ not\ option">
133 a role is not an option
140 , even if its starts a line.
146 <document source="test data">
147 <system_message level="3" line="1" source="test data" type="ERROR">
149 Content block expected for the "note" directive; none found.
150 <literal_block xml:space="preserve">
154 .. admonition:: Admonition
156 This is a generic admonition.
159 <document source="test data">
160 <admonition classes="admonition-admonition">
164 This is a generic admonition.
167 .. admonition:: And, by the way...
169 You can make up your own admonition too.
172 <document source="test data">
173 <admonition classes="admonition-and-by-the-way">
177 You can make up your own admonition too.
180 .. admonition:: Admonition
182 :name: reference name
184 Test the "class" override.
187 <document source="test data">
188 <admonition classes="emergency" ids="reference-name" names="reference\ name">
192 Test the "class" override.
197 Generic admonitions require a title.
200 <document source="test data">
201 <system_message level="3" line="1" source="test data" type="ERROR">
203 Error in "admonition" directive:
204 1 argument(s) required, 0 supplied.
205 <literal_block xml:space="preserve">
208 Generic admonitions require a title.
213 if __name__
== '__main__':
215 unittest
.main(defaultTest
='suite')