4 # Author: David Goodger <goodger@python.org>
5 # Copyright: This module has been placed in the public domain.
11 from __init__
import DocutilsTestSupport
14 s
= DocutilsTestSupport
.ParserTestSuite()
15 s
.generateTests(totest
)
20 totest
['definition_lists'] = [
26 <document source="test data">
28 <definition_list_item>
42 <document source="test data">
44 <definition_list_item>
59 <document source="test data">
61 <definition_list_item>
67 <system_message level="2" line="3" source="test data" type="WARNING">
69 Definition list ends without a blank line; unexpected unindent.
75 A literal block without a blank line first?
78 <document source="test data">
80 <definition_list_item>
84 <system_message level="1" line="2" source="test data" type="INFO">
86 Blank line missing before literal block (after the "::")? Interpreted as a definition list item.
88 A literal block without a blank line first?
92 a term may only be one line long
93 this is not a definition
96 <document source="test data">
99 a term may only be one line long
100 <system_message level="3" line="3" source="test data" type="ERROR">
102 Unexpected indentation.
105 this is not a definition
115 <document source="test data">
117 <definition_list_item>
123 <definition_list_item>
132 definition 1 (no blank line below)
137 <document source="test data">
139 <definition_list_item>
144 definition 1 (no blank line below)
145 <definition_list_item>
154 definition 1 (no blank line below)
157 No blank line after the definition list.
160 <document source="test data">
162 <definition_list_item>
167 definition 1 (no blank line below)
168 <definition_list_item>
174 <system_message level="2" line="5" source="test data" type="WARNING">
176 Definition list ends without a blank line; unexpected unindent.
178 No blank line after the definition list.
196 <document source="test data">
198 <definition_list_item>
205 <definition_list_item>
211 <definition_list_item>
217 <definition_list_item>
228 The ' : ' indicates a classifier in
229 definition list item terms only.
232 <document source="test data">
234 <definition_list_item>
241 The ' : ' indicates a classifier in
242 definition list item terms only.
245 Term: not a classifier
246 Because there's no space before the colon.
247 Term :not a classifier
248 Because there's no space after the colon.
249 Term \: not a classifier
250 Because the colon is escaped.
253 <document source="test data">
255 <definition_list_item>
257 Term: not a classifier
260 Because there's no space before the colon.
261 <definition_list_item>
263 Term :not a classifier
266 Because there's no space after the colon.
267 <definition_list_item>
269 Term : not a classifier
272 Because the colon is escaped.
275 ``Term : not a classifier``
276 Because the ' : ' is inside an inline literal.
279 <document source="test data">
281 <definition_list_item>
284 Term : not a classifier
287 Because the ' : ' is inside an inline literal.
290 Term `with *inline ``text **errors : classifier `with *errors ``too
291 Definition `with *inline ``text **markup errors.
294 <document source="test data">
296 <definition_list_item>
299 <problematic ids="id2" refid="id1">
302 <problematic ids="id4" refid="id3">
305 <problematic ids="id6" refid="id5">
308 <problematic ids="id8" refid="id7">
313 <problematic ids="id10" refid="id9">
316 <problematic ids="id12" refid="id11">
319 <problematic ids="id14" refid="id13">
323 <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
325 Inline interpreted text or phrase reference start-string without end-string.
326 <system_message backrefs="id4" ids="id3" level="2" line="1" source="test data" type="WARNING">
328 Inline emphasis start-string without end-string.
329 <system_message backrefs="id6" ids="id5" level="2" line="1" source="test data" type="WARNING">
331 Inline literal start-string without end-string.
332 <system_message backrefs="id8" ids="id7" level="2" line="1" source="test data" type="WARNING">
334 Inline strong start-string without end-string.
335 <system_message backrefs="id10" ids="id9" level="2" line="1" source="test data" type="WARNING">
337 Inline interpreted text or phrase reference start-string without end-string.
338 <system_message backrefs="id12" ids="id11" level="2" line="1" source="test data" type="WARNING">
340 Inline emphasis start-string without end-string.
341 <system_message backrefs="id14" ids="id13" level="2" line="1" source="test data" type="WARNING">
343 Inline literal start-string without end-string.
346 <problematic ids="id16" refid="id15">
349 <problematic ids="id18" refid="id17">
352 <problematic ids="id20" refid="id19">
355 <problematic ids="id22" refid="id21">
358 <system_message backrefs="id16" ids="id15" level="2" line="2" source="test data" type="WARNING">
360 Inline interpreted text or phrase reference start-string without end-string.
361 <system_message backrefs="id18" ids="id17" level="2" line="2" source="test data" type="WARNING">
363 Inline emphasis start-string without end-string.
364 <system_message backrefs="id20" ids="id19" level="2" line="2" source="test data" type="WARNING">
366 Inline literal start-string without end-string.
367 <system_message backrefs="id22" ids="id21" level="2" line="2" source="test data" type="WARNING">
369 Inline strong start-string without end-string.
372 Term : classifier one : classifier two
376 <document source="test data">
378 <definition_list_item>
391 if __name__
== '__main__':
393 unittest
.main(defaultTest
='suite')