summaryrefslogtreecommitdiff
path: root/docutils/test
diff options
context:
space:
mode:
authorgoodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2005-04-21 14:52:41 +0000
committergoodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2005-04-21 14:52:41 +0000
commit5d17935fd1605f8bdd21e82fe4679a08f5b672ce (patch)
treed02f497b6459297646a3513057ed75f947b075c8 /docutils/test
parent4576cf03bfe915925b41e47d097bc87fab5d0f7c (diff)
downloaddocutils-5d17935fd1605f8bdd21e82fe4679a08f5b672ce.tar.gz
"image" directive: added checks for valid values of "align" option, depending on context. "figure" directive: added specialized "align" option and attribute on "figure" element. Added HTML support for ``align`` attribute on ``figure`` elements. Updated docs & tests.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@3231 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test')
-rw-r--r--docutils/test/functional/expected/standalone_rst_html4css1.html2
-rw-r--r--docutils/test/functional/expected/standalone_rst_pseudoxml.txt2
-rw-r--r--docutils/test/functional/input/data/standard.txt1
-rwxr-xr-xdocutils/test/test_parsers/test_rst/test_directives/test_figures.py13
4 files changed, 16 insertions, 2 deletions
diff --git a/docutils/test/functional/expected/standalone_rst_html4css1.html b/docutils/test/functional/expected/standalone_rst_html4css1.html
index 66879b19f..8ea472629 100644
--- a/docutils/test/functional/expected/standalone_rst_html4css1.html
+++ b/docutils/test/functional/expected/standalone_rst_html4css1.html
@@ -546,7 +546,7 @@ document (a document-wide <a class="reference" href="#table-of-contents">table o
<p>An image directive (also clickable -- a hyperlink reference):</p>
<div class="image class1 class2 image-reference"><a class="reference" href="#directives"><img alt="../../../docs/user/rst/images/title.png" class="class1 class2" src="../../../docs/user/rst/images/title.png" /></a></div>
<p>A figure directive:</p>
-<div class="figclass1 figclass2 figure">
+<div align="left" class="figclass1 figclass2 figure">
<div class="image class1 class2"><img alt="reStructuredText, the markup syntax" class="class1 class2" src="../../../docs/user/rst/images/title.png" /></div>
<p class="caption">A figure is an image with a caption and/or a legend:</p>
<div class="legend">
diff --git a/docutils/test/functional/expected/standalone_rst_pseudoxml.txt b/docutils/test/functional/expected/standalone_rst_pseudoxml.txt
index b4d510854..6fd48b818 100644
--- a/docutils/test/functional/expected/standalone_rst_pseudoxml.txt
+++ b/docutils/test/functional/expected/standalone_rst_pseudoxml.txt
@@ -1121,7 +1121,7 @@
<image classes="class1 class2" uri="../../../docs/user/rst/images/title.png">
<paragraph>
A figure directive:
- <figure classes="figclass1 figclass2">
+ <figure align="left" classes="figclass1 figclass2">
<image alt="reStructuredText, the markup syntax" classes="class1 class2" uri="../../../docs/user/rst/images/title.png">
<caption>
A figure is an image with a caption and/or a legend:
diff --git a/docutils/test/functional/input/data/standard.txt b/docutils/test/functional/input/data/standard.txt
index 092a0ae44..507838b88 100644
--- a/docutils/test/functional/input/data/standard.txt
+++ b/docutils/test/functional/input/data/standard.txt
@@ -429,6 +429,7 @@ A figure directive:
:figclass: figclass1 figclass2
:class: class1 class2
:alt: reStructuredText, the markup syntax
+ :align: left
A figure is an image with a caption and/or a legend:
diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_figures.py b/docutils/test/test_parsers/test_rst/test_directives/test_figures.py
index 821841e07..38c6e821f 100755
--- a/docutils/test/test_parsers/test_rst/test_directives/test_figures.py
+++ b/docutils/test/test_parsers/test_rst/test_directives/test_figures.py
@@ -106,6 +106,19 @@ totest['figures'] = [
A picture with image options on individual lines, and this caption.
"""],
["""\
+.. figure:: picture.png
+ :align: center
+
+ A figure with explicit alignment.
+""",
+"""\
+<document source="test data">
+ <figure align="center">
+ <image uri="picture.png">
+ <caption>
+ A figure with explicit alignment.
+"""],
+["""\
This figure lacks a caption. It may still have a
"Figure 1."-style caption appended in the output.