mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Test that downloads with the same filename are still handled correctly
This commit is contained in:
parent
6fc8873087
commit
9df6e40145
1
tests/roots/test-roles-download/another/dummy.dat
Normal file
1
tests/roots/test-roles-download/another/dummy.dat
Normal file
@ -0,0 +1 @@
|
||||
this one will have some content
|
@ -2,5 +2,6 @@ test-roles-download
|
||||
===================
|
||||
|
||||
* :download:`dummy.dat`
|
||||
* :download:`another/dummy.dat`
|
||||
* :download:`not_found.dat`
|
||||
* :download:`Sphinx logo <http://www.sphinx-doc.org/en/master/_static/sphinxheader.png>`
|
||||
|
@ -453,6 +453,8 @@ def test_html_download_role(app, status, warning):
|
||||
app.build()
|
||||
digest = md5(b'dummy.dat').hexdigest()
|
||||
assert (app.outdir / '_downloads' / digest / 'dummy.dat').exists()
|
||||
digest_another = md5(b'another/dummy.dat').hexdigest()
|
||||
assert (app.outdir / '_downloads' / digest_another / 'dummy.dat').exists()
|
||||
|
||||
content = (app.outdir / 'index.html').text()
|
||||
assert (('<li><p><a class="reference download internal" download="" '
|
||||
@ -460,6 +462,11 @@ def test_html_download_role(app, status, warning):
|
||||
'<code class="xref download docutils literal notranslate">'
|
||||
'<span class="pre">dummy.dat</span></code></a></p></li>' % digest)
|
||||
in content)
|
||||
assert (('<li><p><a class="reference download internal" download="" '
|
||||
'href="_downloads/%s/dummy.dat">'
|
||||
'<code class="xref download docutils literal notranslate">'
|
||||
'<span class="pre">another/dummy.dat</span></code></a></p></li>' %
|
||||
digest_another) 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="" '
|
||||
|
Loading…
Reference in New Issue
Block a user