summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-01-07 19:00:29 +0100
committerGeorg Brandl <georg@python.org>2011-01-07 19:00:29 +0100
commit554c7dd64f6aca38be6e1d26bb2cf4388f46083d (patch)
treea2318b0357a85ab129c5be18df18ce0db2759312 /tests
parent3448ad3099e0c30e6901589b6bd8e181a449c6aa (diff)
downloadsphinx-554c7dd64f6aca38be6e1d26bb2cf4388f46083d.tar.gz
#454: Add more index markup capabilities: marking see/seealso entries, and main entries for a given key.
Diffstat (limited to 'tests')
-rw-r--r--tests/root/markup.txt7
-rw-r--r--tests/test_build_html.py10
-rw-r--r--tests/test_build_latex.py1
3 files changed, 17 insertions, 1 deletions
diff --git a/tests/root/markup.txt b/tests/root/markup.txt
index 60148534..4c6b1086 100644
--- a/tests/root/markup.txt
+++ b/tests/root/markup.txt
@@ -277,6 +277,8 @@ Index markup
double: entry; double
triple: index; entry; triple
keyword: with
+ see: from; to
+ seealso: fromalso; toalso
Invalid index markup...
@@ -285,6 +287,11 @@ Invalid index markup...
pair:
keyword:
+.. index::
+ !Main, !Other
+ !single: entry; pair
+
+:index:`!Main`
.. _ölabel:
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index f89df08c..7e68f8db 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -49,7 +49,7 @@ http://sphinx.pocoo.org/domains.html
HTML_WARNINGS = ENV_WARNINGS + """\
%(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.\\*'
-%(root)s/markup.txt:: WARNING: invalid index entry u''
+%(root)s/markup.txt:: WARNING: invalid single index entry u''
%(root)s/markup.txt:: WARNING: invalid pair index entry u''
%(root)s/markup.txt:: WARNING: invalid pair index entry u'keyword; '
"""
@@ -232,6 +232,14 @@ HTML_XPATH = {
'_static/statictmpl.html': [
(".//project", 'Sphinx <Tests>'),
],
+ 'genindex.html': [
+ # index entries
+ (".//a/strong", "Main"),
+ (".//a/strong", "[1]"),
+ (".//a/strong", "Other"),
+ (".//a", "entry"),
+ (".//dt/a", "double"),
+ ]
}
if pygments:
diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py
index 5fc6e0af..68a8c07c 100644
--- a/tests/test_build_latex.py
+++ b/tests/test_build_latex.py
@@ -30,6 +30,7 @@ latex_warnfile = StringIO()
LATEX_WARNINGS = ENV_WARNINGS + """\
None:None: WARNING: no matching candidate for image URI u'foo.\\*'
WARNING: invalid pair index entry u''
+WARNING: invalid pair index entry u'keyword; '
"""
if sys.version_info >= (3, 0):