summaryrefslogtreecommitdiff
path: root/tests/test_markup.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2016-09-10 23:31:43 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2016-09-15 02:29:50 +0900
commitf8c1c65c21ca91d567a5a083836dfa92a4f48e8a (patch)
tree364ce06d7e74404e9fef00299b9219ff703970e8 /tests/test_markup.py
parent7c99bd5d18197a7fd101ec91f73cb5505487b510 (diff)
downloadsphinx-git-f8c1c65c21ca91d567a5a083836dfa92a4f48e8a.tar.gz
Refactor sphinx.environment: Reimplemnt process_refonly_bullet_lists() as a transform
Diffstat (limited to 'tests/test_markup.py')
-rw-r--r--tests/test_markup.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_markup.py b/tests/test_markup.py
index 45b163ed2..133f187d3 100644
--- a/tests/test_markup.py
+++ b/tests/test_markup.py
@@ -15,6 +15,7 @@ import pickle
from docutils import frontend, utils, nodes
from docutils.parsers import rst
+from sphinx import addnodes
from sphinx.util import texescape
from sphinx.writers.html import HTMLWriter, SmartyPantsHTMLTranslator
from sphinx.writers.latex import LaTeXWriter, LaTeXTranslator
@@ -188,3 +189,21 @@ def test_keep_warnings_is_False(app, status, warning):
doctree = pickle.loads((app.doctreedir / 'index.doctree').bytes())
assert_node(doctree[0], nodes.section)
assert len(doctree[0]) == 1
+
+
+@with_app(buildername='dummy', testroot='refonly_bullet_list')
+def test_compact_refonly_bullet_list(app, status, warning):
+ app.builder.build_all()
+ doctree = pickle.loads((app.doctreedir / 'index.doctree').bytes())
+ assert_node(doctree[0], nodes.section)
+ assert len(doctree[0]) == 5
+
+ assert doctree[0][1].astext() == 'List A:'
+ assert_node(doctree[0][2], nodes.bullet_list)
+ assert_node(doctree[0][2][0][0], addnodes.compact_paragraph)
+ assert doctree[0][2][0][0].astext() == 'genindex'
+
+ assert doctree[0][3].astext() == 'List B:'
+ assert_node(doctree[0][4], nodes.bullet_list)
+ assert_node(doctree[0][4][0][0], nodes.paragraph)
+ assert doctree[0][4][0][0].astext() == 'Hello'