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

« back to all changes in this revision

Viewing changes to test/test_rst/test_citations.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:33 $
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['citations'] = [
23
 
["""\
24
 
.. [citation] This is a citation.
25
 
""",
26
 
"""\
27
 
<document>
28
 
    <citation id="citation" name="citation">
29
 
        <label>
30
 
            citation
31
 
        <paragraph>
32
 
            This is a citation.
33
 
"""],
34
 
["""\
35
 
.. [citation1234] This is a citation with year.
36
 
""",
37
 
"""\
38
 
<document>
39
 
    <citation id="citation1234" name="citation1234">
40
 
        <label>
41
 
            citation1234
42
 
        <paragraph>
43
 
            This is a citation with year.
44
 
"""],
45
 
["""\
46
 
.. [citation] This is a citation
47
 
   on multiple lines.
48
 
""",
49
 
"""\
50
 
<document>
51
 
    <citation id="citation" name="citation">
52
 
        <label>
53
 
            citation
54
 
        <paragraph>
55
 
            This is a citation
56
 
            on multiple lines.
57
 
"""],
58
 
["""\
59
 
.. [citation1] This is a citation
60
 
     on multiple lines with more space.
61
 
 
62
 
.. [citation2] This is a citation
63
 
  on multiple lines with less space.
64
 
""",
65
 
"""\
66
 
<document>
67
 
    <citation id="citation1" name="citation1">
68
 
        <label>
69
 
            citation1
70
 
        <paragraph>
71
 
            This is a citation
72
 
            on multiple lines with more space.
73
 
    <citation id="citation2" name="citation2">
74
 
        <label>
75
 
            citation2
76
 
        <paragraph>
77
 
            This is a citation
78
 
            on multiple lines with less space.
79
 
"""],
80
 
["""\
81
 
.. [citation]
82
 
   This is a citation on multiple lines
83
 
   whose block starts on line 2.
84
 
""",
85
 
"""\
86
 
<document>
87
 
    <citation id="citation" name="citation">
88
 
        <label>
89
 
            citation
90
 
        <paragraph>
91
 
            This is a citation on multiple lines
92
 
            whose block starts on line 2.
93
 
"""],
94
 
["""\
95
 
.. [citation]
96
 
 
97
 
That was an empty citation.
98
 
""",
99
 
"""\
100
 
<document>
101
 
    <citation id="citation" name="citation">
102
 
        <label>
103
 
            citation
104
 
    <paragraph>
105
 
        That was an empty citation.
106
 
"""],
107
 
["""\
108
 
.. [citation]
109
 
No blank line.
110
 
""",
111
 
"""\
112
 
<document>
113
 
    <citation id="citation" name="citation">
114
 
        <label>
115
 
            citation
116
 
    <system_message level="2" type="WARNING">
117
 
        <paragraph>
118
 
            Explicit markup ends without a blank line; unexpected unindent at line 2.
119
 
    <paragraph>
120
 
        No blank line.
121
 
"""],
122
 
["""\
123
 
.. [citation label with spaces] this isn't a citation
124
 
 
125
 
.. [*citationlabelwithmarkup*] this isn't a citation
126
 
""",
127
 
"""\
128
 
<document>
129
 
    <comment>
130
 
        [citation label with spaces] this isn't a citation
131
 
    <comment>
132
 
        [*citationlabelwithmarkup*] this isn't a citation
133
 
"""],
134
 
]
135
 
 
136
 
 
137
 
if __name__ == '__main__':
138
 
    import unittest
139
 
    unittest.main(defaultTest='suite')