5
:Contact: goodger@users.sourceforge.net
6
:Revision: $Revision: 1.3 $
7
:Date: $Date: 2002/06/28 04:20:46 $
8
:Copyright: This module has been placed in the public domain.
10
Tests for images.py image directives.
13
from __init__ import DocutilsTestSupport
16
s = DocutilsTestSupport.ParserTestSuite()
17
s.generateTests(totest)
24
.. image:: picture.png
28
<image uri="picture.png">
35
<system_message level="3" type="ERROR">
37
Missing image URI argument at line 1.
42
.. image:: one two three
46
<system_message level="3" type="ERROR">
48
Image URI at line 1 contains whitespace.
50
.. image:: one two three
53
.. image:: picture.png
60
<image height="100" scale="50" uri="picture.png" width="200">
71
<image height="100" scale="50" uri="picture.png" width="200">
81
<system_message level="3" type="ERROR">
83
Missing image URI argument at line 1.
91
.. image:: a/very/long/path/to/
99
<image height="100" scale="50" uri="a/very/long/path/to/picture.png" width="200">
102
.. image:: picture.png
106
:alt: Alternate text for the picture
110
<image alt="Alternate text for the picture" height="100" scale="50" uri="picture.png" width="200">
113
.. image:: picture.png
118
<system_message level="3" type="ERROR">
120
Error in "image" directive attributes at line 1:
121
invalid attribute data: extension attribute field body may contain
122
a single paragraph only (attribute "scale").
124
.. image:: picture.png
128
.. image:: picture.png
133
<system_message level="3" type="ERROR">
135
Error in "image" directive attributes at line 1:
136
invalid attribute value:
137
(attribute "scale", value "None") object can't be converted to int.
139
.. image:: picture.png
143
.. image:: picture.png
148
<system_message level="3" type="ERROR">
150
Error in "image" directive attributes at line 1:
151
invalid attribute block.
153
.. image:: picture.png
157
.. image:: picture.png
162
<system_message level="3" type="ERROR">
164
Image URI at line 1 contains whitespace.
166
.. image:: picture.png
170
.. image:: picture.png
175
<system_message level="3" type="ERROR">
177
Error in "image" directive attributes at line 1:
178
invalid attribute block.
180
.. image:: picture.png
184
.. image:: picture.png
189
<system_message level="3" type="ERROR">
191
Error in "image" directive attributes at line 1:
192
unknown attribute: "sale".
194
.. image:: picture.png
198
.. image:: picture.png
203
<system_message level="3" type="ERROR">
205
Error in "image" directive attributes at line 1:
206
invalid attribute value:
207
(attribute "scale", value "fifty") invalid literal for int(): fifty.
209
.. image:: picture.png
213
.. image:: picture.png
219
<system_message level="3" type="ERROR">
221
Error in "image" directive attributes at line 1:
222
invalid attribute data: duplicate attribute "scale".
224
.. image:: picture.png
231
if __name__ == '__main__':
233
unittest.main(defaultTest='suite')