Refactor: Use copy_asset() to copy html_static_path

This commit is contained in:
Takeshi KOMIYA
2016-07-07 00:06:54 +09:00
parent bb1e6f9044
commit 02dbf860c2
20 changed files with 26 additions and 9 deletions
@@ -1,6 +1,9 @@
# -*- coding: utf-8 -*-
master_doc = 'index'
project = 'Sphinx'
version = '1.4.4'
html_static_path = ['static', 'subdir']
html_extra_path = ['extra', 'subdir']
exclude_patterns = ['**/_build', '**/.htpasswd']
@@ -0,0 +1 @@
{{ project }}-{{ version }}
@@ -0,0 +1 @@
{{ project }}-{{ version }}
Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

+15 -2
View File
@@ -976,10 +976,23 @@ def test_jsmath(app, status, warning):
assert '<div class="math">\na + 1 &lt; b</div>' in content
@with_app(buildername='html', testroot='html_extra_path')
def test_html_extra_path(app, status, warning):
@with_app(buildername='html', testroot='html_assets')
def test_html_assets(app, status, warning):
app.builder.build_all()
# html_static_path
assert not (app.outdir / '_static' / '.htaccess').exists()
assert not (app.outdir / '_static' / '.htpasswd').exists()
assert (app.outdir / '_static' / 'API.html').exists()
assert (app.outdir / '_static' / 'API.html').text() == 'Sphinx-1.4.4'
assert (app.outdir / '_static' / 'css/style.css').exists()
assert (app.outdir / '_static' / 'rimg.png').exists()
assert not (app.outdir / '_static' / '_build/index.html').exists()
assert (app.outdir / '_static' / 'background.png').exists()
assert not (app.outdir / '_static' / 'subdir' / '.htaccess').exists()
assert not (app.outdir / '_static' / 'subdir' / '.htpasswd').exists()
# html_extra_path
assert (app.outdir / '.htaccess').exists()
assert not (app.outdir / '.htpasswd').exists()
assert (app.outdir / 'API.html_t').exists()