Spelling fixes
[docutils.git] / test / test_parsers / test_rst / test_directives / test_parsed_literals.py
blob6cfefeaa7257235855c7e6fccd945c19ec84c736
1 #! /usr/bin/env python
3 # $Id$
4 # Author: Lea Wiemann <LeWiemann@gmail.com>
5 # Copyright: This module has been placed in the public domain.
7 """
8 Tests for the body.py 'parsed-literal' 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['parsed_literals'] = [
21 ["""\
22 .. parsed-literal::
24 This is a parsed literal block.
25 It may contain *inline markup
26 spanning lines.*
27 """,
28 """\
29 <document source="test data">
30 <literal_block xml:space="preserve">
31 This is a parsed literal block.
32 It may contain \n\
33 <emphasis>
34 inline markup
35 spanning lines.
36 """],
37 ["""\
38 .. parsed-literal::
39 :class: myliteral
40 :name: example: parsed
42 This is a parsed literal block with options.
43 """,
44 """\
45 <document source="test data">
46 <literal_block classes="myliteral" ids="example-parsed" names="example:\ parsed" xml:space="preserve">
47 This is a parsed literal block with options.
48 """],
49 ["""\
50 .. parsed-literal:: content may start on same line
51 """,
52 """\
53 <document source="test data">
54 <literal_block xml:space="preserve">
55 content may start on same line
56 """],
57 ["""\
58 .. parsed-literal::
59 """,
60 """\
61 <document source="test data">
62 <system_message level="3" line="1" source="test data" type="ERROR">
63 <paragraph>
64 Content block expected for the "parsed-literal" directive; none found.
65 <literal_block xml:space="preserve">
66 .. parsed-literal::
67 """],
71 if __name__ == '__main__':
72 import unittest
73 unittest.main(defaultTest='suite')