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

« back to all changes in this revision

Viewing changes to test/test_pep/test_inline_markup.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/07/14 03:24:27 $
8
 
:Copyright: This module has been placed in the public domain.
9
 
 
10
 
Tests for inline markup in PEPs (readers/pep.py).
11
 
"""
12
 
 
13
 
from __init__ import DocutilsTestSupport
14
 
 
15
 
 
16
 
def suite():
17
 
    s = DocutilsTestSupport.PEPParserTestSuite()
18
 
    s.generateTests(totest)
19
 
    return s
20
 
 
21
 
 
22
 
totest = {}
23
 
 
24
 
totest['standalone_references'] = [
25
 
["""\
26
 
See PEP 287 (pep-0287.txt),
27
 
and RFC 2822 (which obsoletes RFC822 and RFC-733).
28
 
""",
29
 
"""\
30
 
<document>
31
 
    <paragraph>
32
 
        See \n\
33
 
        <reference refuri="pep-0287.html">
34
 
            PEP 287
35
 
         (
36
 
        <reference refuri="pep-0287.html">
37
 
            pep-0287.txt
38
 
        ),
39
 
        and \n\
40
 
        <reference refuri="http://www.faqs.org/rfcs/rfc2822.html">
41
 
            RFC 2822
42
 
         (which obsoletes \n\
43
 
        <reference refuri="http://www.faqs.org/rfcs/rfc822.html">
44
 
            RFC822
45
 
         and \n\
46
 
        <reference refuri="http://www.faqs.org/rfcs/rfc733.html">
47
 
            RFC-733
48
 
        ).
49
 
"""],
50
 
["""\
51
 
References split across lines:
52
 
 
53
 
PEP
54
 
287
55
 
 
56
 
RFC
57
 
2822
58
 
""",
59
 
"""\
60
 
<document>
61
 
    <paragraph>
62
 
        References split across lines:
63
 
    <paragraph>
64
 
        <reference refuri="pep-0287.html">
65
 
            PEP
66
 
            287
67
 
    <paragraph>
68
 
        <reference refuri="http://www.faqs.org/rfcs/rfc2822.html">
69
 
            RFC
70
 
            2822
71
 
"""],
72
 
["""\
73
 
Test PEP-specific implicit references before a URL:
74
 
 
75
 
PEP 287 (http://www.python.org/peps/pep-0287.html), RFC 2822.
76
 
""",
77
 
"""\
78
 
<document>
79
 
    <paragraph>
80
 
        Test PEP-specific implicit references before a URL:
81
 
    <paragraph>
82
 
        <reference refuri="pep-0287.html">
83
 
            PEP 287
84
 
         (
85
 
        <reference refuri="http://www.python.org/peps/pep-0287.html">
86
 
            http://www.python.org/peps/pep-0287.html
87
 
        ), \n\
88
 
        <reference refuri="http://www.faqs.org/rfcs/rfc2822.html">
89
 
            RFC 2822
90
 
        .
91
 
"""],
92
 
]
93
 
 
94
 
totest['miscellaneous'] = [
95
 
["""\
96
 
For *completeness*, _`let's` ``test`` **other** forms_
97
 
|of| `inline markup` [*]_.
98
 
 
99
 
.. [*] See http://docutils.sf.net/spec/rst/reStructuredText.html.
100
 
""",
101
 
"""\
102
 
<document>
103
 
    <paragraph>
104
 
        For \n\
105
 
        <emphasis>
106
 
            completeness
107
 
        , \n\
108
 
        <target id="let-s" name="let's">
109
 
            let's
110
 
         \n\
111
 
        <literal>
112
 
            test
113
 
         \n\
114
 
        <strong>
115
 
            other
116
 
         \n\
117
 
        <reference refname="forms">
118
 
            forms
119
 
        \n\
120
 
        <substitution_reference refname="of">
121
 
            of
122
 
         \n\
123
 
        <interpreted>
124
 
            inline markup
125
 
         \n\
126
 
        <footnote_reference auto="*" id="id1">
127
 
        .
128
 
    <footnote auto="*" id="id2">
129
 
        <paragraph>
130
 
            See \n\
131
 
            <reference refuri="http://docutils.sf.net/spec/rst/reStructuredText.html">
132
 
                http://docutils.sf.net/spec/rst/reStructuredText.html
133
 
            .
134
 
"""],
135
 
]
136
 
 
137
 
 
138
 
if __name__ == '__main__':
139
 
    import unittest
140
 
    unittest.main(defaultTest='suite')