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

« back to all changes in this revision

Viewing changes to test/test_parsers/test_rst/test_directives/test_figures.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.9 $
6
 
# Date: $Date: 2003/04/18 21:41:59 $
 
5
# Revision: $Revision: 3352 $
 
6
# Date: $Date: 2005-05-19 00:31:15 +0200 (Thu, 19 May 2005) $
7
7
# Copyright: This module has been placed in the public domain.
8
8
 
9
9
"""
29
29
        <image uri="picture.png">
30
30
"""],
31
31
["""\
32
 
.. figure:: not an image URI
33
 
""",
34
 
"""\
35
 
<document source="test data">
36
 
    <system_message level="3" line="1" source="test data" type="ERROR">
37
 
        <paragraph>
38
 
            Image URI contains whitespace.
39
 
        <literal_block xml:space="preserve">
40
 
            .. figure:: not an image URI
41
 
"""],
42
 
["""\
43
32
.. figure:: picture.png
44
33
 
45
34
   A picture with a caption.
69
58
               - A picture with an invalid caption.
70
59
"""],
71
60
["""\
72
 
.. figure:: not an image URI
73
 
 
74
 
   And a caption.
75
 
""",
76
 
"""\
77
 
<document source="test data">
78
 
    <system_message level="3" line="1" source="test data" type="ERROR">
79
 
        <paragraph>
80
 
            Image URI contains whitespace.
81
 
        <literal_block xml:space="preserve">
82
 
            .. figure:: not an image URI
83
 
            \n\
84
 
               And a caption.
85
 
"""],
86
 
["""\
87
61
.. figure:: picture.png
88
62
 
89
63
   ..
120
94
   :width: 200
121
95
   :scale: 50
122
96
   :figwidth: 300
 
97
   :figclass: class1 class2
123
98
 
124
99
   A picture with image options on individual lines, and this caption.
125
100
""",
126
101
"""\
127
102
<document source="test data">
128
 
    <figure width="300">
 
103
    <figure classes="class1 class2" width="300">
129
104
        <image alt="alternate text" height="100" scale="50" uri="picture.png" width="200">
130
105
        <caption>
131
106
            A picture with image options on individual lines, and this caption.
132
107
"""],
133
108
["""\
 
109
.. figure:: picture.png
 
110
   :align: center
 
111
 
 
112
   A figure with explicit alignment.
 
113
""",
 
114
"""\
 
115
<document source="test data">
 
116
    <figure align="center">
 
117
        <image uri="picture.png">
 
118
        <caption>
 
119
            A figure with explicit alignment.
 
120
"""],
 
121
["""\
 
122
.. figure:: picture.png
 
123
   :align: top
 
124
 
 
125
   A figure with wrong alignment.
 
126
""",
 
127
"""\
 
128
<document source="test data">
 
129
    <system_message level="3" line="1" source="test data" type="ERROR">
 
130
        <paragraph>
 
131
            Error in "figure" directive:
 
132
            invalid option value: (option: "align"; value: 'top')
 
133
            "top" unknown; choose from "left", "center", or "right".
 
134
        <literal_block xml:space="preserve">
 
135
            .. figure:: picture.png
 
136
               :align: top
 
137
            
 
138
               A figure with wrong alignment.
 
139
"""],
 
140
["""\
134
141
This figure lacks a caption. It may still have a
135
142
"Figure 1."-style caption appended in the output.
136
143