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_line_blocks.py
blob289fd6741513109b67cfdf5e422650da59daa03b
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 body.py 'line-block' directive.
9 """
11 from __init__ import DocutilsTestSupport
13 def suite():
14 s = DocutilsTestSupport.ParserTestSuite()
15 s.generateTests(totest)
16 return s
18 totest = {}
20 totest['line_blocks'] = [
21 ["""\
22 .. line-block::
24 This is a line block.
25 Newlines are *preserved*.
26 As is initial whitespace.
27 """,
28 """\
29 <document source="test data">
30 <line_block>
31 <line>
32 This is a line block.
33 <line>
34 Newlines are \n\
35 <emphasis>
36 preserved
38 <line_block>
39 <line>
40 As is initial whitespace.
41 """],
42 ["""\
43 .. line-block::
44 :class: linear
45 :name: cit:short
47 This is a line block with options.
48 """,
49 """\
50 <document source="test data">
51 <line_block classes="linear" ids="cit-short" names="cit:short">
52 <line>
53 This is a line block with options.
54 """],
55 ["""\
56 .. line-block::
58 Inline markup *may not span
59 multiple lines* of a line block.
60 """,
61 """\
62 <document source="test data">
63 <line_block>
64 <line>
65 Inline markup \n\
66 <problematic ids="id2" refid="id1">
68 may not span
69 <line_block>
70 <line>
71 multiple lines* of a line block.
72 <system_message backrefs="id2" ids="id1" level="2" line="3" source="test data" type="WARNING">
73 <paragraph>
74 Inline emphasis start-string without end-string.
75 """],
76 ["""\
77 .. line-block::
78 """,
79 """\
80 <document source="test data">
81 <system_message level="3" line="1" source="test data" type="ERROR">
82 <paragraph>
83 Content block expected for the "line-block" directive; none found.
84 <literal_block xml:space="preserve">
85 .. line-block::
86 """],
90 if __name__ == '__main__':
91 import unittest
92 unittest.main(defaultTest='suite')