~ubuntu-branches/ubuntu/karmic/python-docutils/karmic

« back to all changes in this revision

Viewing changes to test/test_rst/test_block_quotes.py

  • Committer: Bazaar Package Importer
  • Author(s): martin f. krafft
  • Date: 2006-07-10 11:45:05 UTC
  • mfrom: (2.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20060710114505-otkhqcslevewxmz5
Tags: 0.4-3
Added build dependency on python-central (closes: #377580).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/env python
2
 
 
3
 
"""
4
 
:Author: David Goodger
5
 
:Contact: goodger@users.sourceforge.net
6
 
:Revision: $Revision: 1.3 $
7
 
:Date: $Date: 2002/04/25 03:40:06 $
8
 
:Copyright: This module has been placed in the public domain.
9
 
 
10
 
Tests for states.py.
11
 
"""
12
 
 
13
 
from __init__ import DocutilsTestSupport
14
 
 
15
 
def suite():
16
 
    s = DocutilsTestSupport.ParserTestSuite()
17
 
    s.generateTests(totest)
18
 
    return s
19
 
 
20
 
totest = {}
21
 
 
22
 
totest['block_quotes'] = [
23
 
["""\
24
 
Line 1.
25
 
Line 2.
26
 
 
27
 
   Indented.
28
 
""",
29
 
"""\
30
 
<document>
31
 
    <paragraph>
32
 
        Line 1.
33
 
        Line 2.
34
 
    <block_quote>
35
 
        <paragraph>
36
 
            Indented.
37
 
"""],
38
 
["""\
39
 
Line 1.
40
 
Line 2.
41
 
 
42
 
   Indented 1.
43
 
 
44
 
      Indented 2.
45
 
""",
46
 
"""\
47
 
<document>
48
 
    <paragraph>
49
 
        Line 1.
50
 
        Line 2.
51
 
    <block_quote>
52
 
        <paragraph>
53
 
            Indented 1.
54
 
        <block_quote>
55
 
            <paragraph>
56
 
                Indented 2.
57
 
"""],
58
 
["""\
59
 
Line 1.
60
 
Line 2.
61
 
    Unexpectedly indented.
62
 
""",
63
 
"""\
64
 
<document>
65
 
    <paragraph>
66
 
        Line 1.
67
 
        Line 2.
68
 
    <system_message level="3" type="ERROR">
69
 
        <paragraph>
70
 
            Unexpected indentation at line 3.
71
 
    <block_quote>
72
 
        <paragraph>
73
 
            Unexpectedly indented.
74
 
"""],
75
 
["""\
76
 
Line 1.
77
 
Line 2.
78
 
 
79
 
   Indented.
80
 
no blank line
81
 
""",
82
 
"""\
83
 
<document>
84
 
    <paragraph>
85
 
        Line 1.
86
 
        Line 2.
87
 
    <block_quote>
88
 
        <paragraph>
89
 
            Indented.
90
 
    <system_message level="2" type="WARNING">
91
 
        <paragraph>
92
 
            Block quote ends without a blank line; unexpected unindent at line 5.
93
 
    <paragraph>
94
 
        no blank line
95
 
"""],
96
 
["""\
97
 
Here is a paragraph.
98
 
 
99
 
        Indent 8 spaces.
100
 
 
101
 
    Indent 4 spaces.
102
 
 
103
 
Is this correct? Should it generate a warning?
104
 
Yes, it is correct, no warning necessary.
105
 
""",
106
 
"""\
107
 
<document>
108
 
    <paragraph>
109
 
        Here is a paragraph.
110
 
    <block_quote>
111
 
        <block_quote>
112
 
            <paragraph>
113
 
                Indent 8 spaces.
114
 
        <paragraph>
115
 
            Indent 4 spaces.
116
 
    <paragraph>
117
 
        Is this correct? Should it generate a warning?
118
 
        Yes, it is correct, no warning necessary.
119
 
"""],
120
 
]
121
 
 
122
 
if __name__ == '__main__':
123
 
    import unittest
124
 
    unittest.main(defaultTest='suite')