diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-06-18 21:39:07 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-18 21:39:07 +0900 |
commit | aeb9401c203952d9978ad0436dcca73bb04c49aa (patch) | |
tree | 949819cefed0e2f192d1d20b8e158615aef2666c /tests/test_build_html.py | |
parent | 288bf231e68e327876510c9b39b16b7512718373 (diff) | |
parent | d8208d406a0c470b34de79c4b054ba05f50ae34c (diff) | |
download | sphinx-git-aeb9401c203952d9978ad0436dcca73bb04c49aa.tar.gz |
Merge pull request #6500 from tk0miya/1464_warning_html_static_path_inside_outdir
Close #1464: html: warn html_static_path is inside outdir
Diffstat (limited to 'tests/test_build_html.py')
-rw-r--r-- | tests/test_build_html.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_build_html.py b/tests/test_build_html.py index 677ca9de0..352166d94 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -16,6 +16,7 @@ from itertools import cycle, chain import pytest from html5lib import HTMLParser +from sphinx.builders.html import validate_html_extra_path, validate_html_static_path from sphinx.errors import ConfigError from sphinx.testing.util import strip_escseq from sphinx.util import docutils @@ -1496,3 +1497,29 @@ def test_html_pygments_style_manually(app): def test_html_pygments_for_classic_theme(app): style = app.builder.highlighter.formatter_args.get('style') assert style.__name__ == 'SphinxStyle' + + +@pytest.mark.sphinx(testroot='basic', srcdir='validate_html_extra_path') +def test_validate_html_extra_path(app): + (app.confdir / '_static').makedirs() + app.config.html_extra_path = [ + '/path/to/not_found', # not found + '_static', + app.outdir, # outdir + app.outdir / '_static', # inside outdir + ] + validate_html_extra_path(app, app.config) + assert app.config.html_extra_path == ['_static'] + + +@pytest.mark.sphinx(testroot='basic', srcdir='validate_html_static_path') +def test_validate_html_static_path(app): + (app.confdir / '_static').makedirs() + app.config.html_static_path = [ + '/path/to/not_found', # not found + '_static', + app.outdir, # outdir + app.outdir / '_static', # inside outdir + ] + validate_html_static_path(app, app.config) + assert app.config.html_static_path == ['_static'] |