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

« back to all changes in this revision

Viewing changes to test/test_rst/test_outdenting.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.2 $
7
 
:Date: $Date: 2002/04/25 03:43:24 $
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['outdenting'] = [
23
 
["""\
24
 
Anywhere a paragraph would have an effect on the current
25
 
indentation level, a comment or list item should also.
26
 
 
27
 
+ bullet
28
 
 
29
 
This paragraph ends the bullet list item before a block quote.
30
 
 
31
 
  Block quote.
32
 
""",
33
 
"""\
34
 
<document>
35
 
    <paragraph>
36
 
        Anywhere a paragraph would have an effect on the current
37
 
        indentation level, a comment or list item should also.
38
 
    <bullet_list bullet="+">
39
 
        <list_item>
40
 
            <paragraph>
41
 
                bullet
42
 
    <paragraph>
43
 
        This paragraph ends the bullet list item before a block quote.
44
 
    <block_quote>
45
 
        <paragraph>
46
 
            Block quote.
47
 
"""],
48
 
["""\
49
 
+ bullet
50
 
 
51
 
.. Comments swallow up all indented text following.
52
 
 
53
 
  (Therefore this is not a) block quote.
54
 
 
55
 
- bullet
56
 
 
57
 
  If we want a block quote after this bullet list item,
58
 
  we need to use an empty comment:
59
 
 
60
 
..
61
 
 
62
 
  Block quote.
63
 
""",
64
 
"""\
65
 
<document>
66
 
    <bullet_list bullet="+">
67
 
        <list_item>
68
 
            <paragraph>
69
 
                bullet
70
 
    <comment>
71
 
        Comments swallow up all indented text following.
72
 
        \n\
73
 
        (Therefore this is not a) block quote.
74
 
    <bullet_list bullet="-">
75
 
        <list_item>
76
 
            <paragraph>
77
 
                bullet
78
 
            <paragraph>
79
 
                If we want a block quote after this bullet list item,
80
 
                we need to use an empty comment:
81
 
    <comment>
82
 
    <block_quote>
83
 
        <paragraph>
84
 
            Block quote.
85
 
"""],
86
 
]
87
 
 
88
 
if __name__ == '__main__':
89
 
    import unittest
90
 
    unittest.main(defaultTest='suite')