~ubuntu-branches/ubuntu/jaunty/python-docutils/jaunty

« back to all changes in this revision

Viewing changes to test/test_parsers/test_rst/test_transitions.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:
2
2
 
3
3
# Author: David Goodger
4
4
# Contact: goodger@users.sourceforge.net
5
 
# Revision: $Revision: 1.7 $
6
 
# Date: $Date: 2002/10/31 02:43:26 $
 
5
# Revision: $Revision: 3915 $
 
6
# Date: $Date: 2005-10-02 03:06:42 +0200 (Sun, 02 Oct 2005) $
7
7
# Copyright: This module has been placed in the public domain.
8
8
 
9
9
"""
52
52
""",
53
53
"""\
54
54
<document source="test data">
55
 
    <section id="section-1" name="section 1">
 
55
    <section ids="section-1" names="section\ 1">
56
56
        <title>
57
57
            Section 1
58
58
        <paragraph>
60
60
        <transition>
61
61
        <paragraph>
62
62
            Second text division of section 1.
63
 
        <section id="section-2" name="section 2">
 
63
        <section ids="section-2" names="section\ 2">
64
64
            <title>
65
65
                Section 2
66
66
            <paragraph>
87
87
""",
88
88
"""\
89
89
<document source="test data">
90
 
    <system_message level="3" line="1" source="test data" type="ERROR">
91
 
        <paragraph>
92
 
            Document or section may not begin with a transition.
93
90
    <transition>
94
91
    <paragraph>
95
92
        A section or document may not begin with a transition.
97
94
        The DTD specifies that two transitions may not
98
95
        be adjacent:
99
96
    <transition>
100
 
    <system_message level="3" line="10" source="test data" type="ERROR">
101
 
        <paragraph>
102
 
            At least one body element must separate transitions; adjacent transitions not allowed.
103
97
    <transition>
104
 
    <system_message level="3" line="12" source="test data" type="ERROR">
105
 
        <paragraph>
106
 
            At least one body element must separate transitions; adjacent transitions not allowed.
107
98
    <transition>
108
99
    <paragraph>
109
100
        The DTD also specifies that a section or document
110
101
        may not end with a transition.
111
102
    <transition>
112
 
    <system_message level="3" line="17" source="test data" type="ERROR">
113
 
        <paragraph>
114
 
            Document or section may not end with a transition.
115
103
"""],
116
104
["""\
117
105
Test unexpected transition markers.
161
149
 
162
150
----------
163
151
 
164
 
Illegal transitions.
 
152
The next transition is legal:
165
153
 
166
154
----------
167
155
 
174
162
<document source="test data">
175
163
    <paragraph>
176
164
        Sections with transitions at beginning and end.
177
 
    <section id="section-1" name="section 1">
 
165
    <section ids="section-1" names="section\ 1">
178
166
        <title>
179
167
            Section 1
180
 
        <system_message level="3" line="6" source="test data" type="ERROR">
181
 
            <paragraph>
182
 
                Section may not begin with a transition.
183
168
        <transition>
184
169
        <paragraph>
185
 
            Illegal transitions.
 
170
            The next transition is legal:
186
171
        <transition>
187
 
        <system_message level="3" line="10" source="test data" type="ERROR">
188
 
            <paragraph>
189
 
                Section may not end with a transition.
190
 
    <section id="section-2" name="section 2">
 
172
    <section ids="section-2" names="section\ 2">
191
173
        <title>
192
174
            Section 2
193
 
        <system_message level="3" line="15" source="test data" type="ERROR">
194
 
            <paragraph>
195
 
                Section may not begin with a transition.
196
175
        <transition>
197
 
        <system_message level="3" line="15" source="test data" type="ERROR">
198
 
            <paragraph>
199
 
                Document or section may not end with a transition.
 
176
"""],
 
177
["""\
 
178
A paragraph, two transitions, and a blank line.
 
179
 
 
180
----------
 
181
 
 
182
----------
 
183
 
 
184
""",
 
185
"""\
 
186
<document source="test data">
 
187
    <paragraph>
 
188
        A paragraph, two transitions, and a blank line.
 
189
    <transition>
 
190
    <transition>
 
191
"""],
 
192
["""\
 
193
A paragraph and two transitions.
 
194
 
 
195
----------
 
196
 
 
197
----------
 
198
""", # the same:
 
199
"""\
 
200
<document source="test data">
 
201
    <paragraph>
 
202
        A paragraph and two transitions.
 
203
    <transition>
 
204
    <transition>
200
205
"""],
201
206
["""\
202
207
----------
205
210
""",
206
211
"""\
207
212
<document source="test data">
208
 
    <system_message level="3" line="1" source="test data" type="ERROR">
209
 
        <paragraph>
210
 
            Document or section may not begin with a transition.
211
213
    <transition>
212
214
    <paragraph>
213
215
        Document beginning with a transition.
214
216
"""],
 
217
["""\
 
218
Section 1
 
219
=========
 
220
 
 
221
Subsection 1
 
222
------------
 
223
 
 
224
Some text.
 
225
 
 
226
----------
 
227
 
 
228
Section 2
 
229
=========
 
230
 
 
231
Some text.
 
232
""",
 
233
"""\
 
234
<document source="test data">
 
235
    <section ids="section-1" names="section\ 1">
 
236
        <title>
 
237
            Section 1
 
238
        <section ids="subsection-1" names="subsection\ 1">
 
239
            <title>
 
240
                Subsection 1
 
241
            <paragraph>
 
242
                Some text.
 
243
            <transition>
 
244
    <section ids="section-2" names="section\ 2">
 
245
        <title>
 
246
            Section 2
 
247
        <paragraph>
 
248
            Some text.
 
249
"""],
 
250
["""\
 
251
Section 1
 
252
=========
 
253
 
 
254
----------
 
255
 
 
256
----------
 
257
 
 
258
----------
 
259
 
 
260
Section 2
 
261
=========
 
262
 
 
263
Some text.
 
264
""",
 
265
"""\
 
266
<document source="test data">
 
267
    <section ids="section-1" names="section\ 1">
 
268
        <title>
 
269
            Section 1
 
270
        <transition>
 
271
        <transition>
 
272
        <transition>
 
273
    <section ids="section-2" names="section\ 2">
 
274
        <title>
 
275
            Section 2
 
276
        <paragraph>
 
277
            Some text.
 
278
"""],
 
279
["""\
 
280
----------
 
281
 
 
282
----------
 
283
 
 
284
----------
 
285
""",
 
286
"""\
 
287
<document source="test data">
 
288
    <transition>
 
289
    <transition>
 
290
    <transition>
 
291
"""],
 
292
["""\
 
293
A paragraph.
 
294
 
 
295
----------
 
296
 
 
297
""",
 
298
"""\
 
299
<document source="test data">
 
300
    <paragraph>
 
301
        A paragraph.
 
302
    <transition>
 
303
"""],
215
304
]
216
305
 
217
306