summaryrefslogtreecommitdiff
path: root/tests/test_build_html5.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-08-25 21:53:36 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-08-26 22:25:35 +0900
commitaee5fd04d449e3513b72277085b96bd1e9c01a36 (patch)
treef554f4b17cf5a3c9d13f798647359f63e40cae02 /tests/test_build_html5.py
parent8f253cfb8e97a8d0c6774f44182c6298baaf1313 (diff)
downloadsphinx-git-aee5fd04d449e3513b72277085b96bd1e9c01a36.tar.gz
Fix #5348: download reference to remote file is not displayed
Diffstat (limited to 'tests/test_build_html5.py')
-rw-r--r--tests/test_build_html5.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_build_html5.py b/tests/test_build_html5.py
index 82050cee1..21da21224 100644
--- a/tests/test_build_html5.py
+++ b/tests/test_build_html5.py
@@ -321,3 +321,23 @@ def test_html5_output(app, cached_etree_parse, fname, expect):
app.build()
print(app.outdir / fname)
check_xpath(cached_etree_parse(app.outdir / fname), fname, *expect)
+
+
+@pytest.mark.sphinx('html', testroot='roles-download',
+ confoverrides={'html_experimental_html5_writer': True})
+def test_html_download_role(app, status, warning):
+ app.build()
+ assert (app.outdir / '_downloads' / 'dummy.dat').exists()
+
+ content = (app.outdir / 'index.html').text()
+ assert ('<li><p><a class="reference download internal" download="" '
+ 'href="_downloads/dummy.dat">'
+ '<code class="xref download docutils literal notranslate">'
+ '<span class="pre">dummy.dat</span></code></a></p></li>' in content)
+ assert ('<li><p><code class="xref download docutils literal notranslate">'
+ '<span class="pre">not_found.dat</span></code></p></li>' in content)
+ assert ('<li><p><a class="reference download external" download="" '
+ 'href="http://www.sphinx-doc.org/en/master/_static/sphinxheader.png">'
+ '<code class="xref download docutils literal notranslate">'
+ '<span class="pre">Sphinx</span> <span class="pre">logo</span>'
+ '</code></a></p></li>' in content)