diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-10-30 13:36:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-30 13:36:10 +0900 |
commit | 215be8e5bd897bba9d576e2bb957cb038bd356fb (patch) | |
tree | b417cf3feae0f9c7796bec77412ee9d597b053d6 /tests/test_build_html.py | |
parent | d7d2e823fc1a59a4c94c471b4f1dfa1501f226b4 (diff) | |
parent | c0aa0ce2d8bd96406f785dd5d225eca68b32b69b (diff) | |
download | sphinx-git-215be8e5bd897bba9d576e2bb957cb038bd356fb.tar.gz |
Merge pull request #4177 from tk0miya/improve_theme_sidebars
HTML themes can set up default sidebars through ``theme.conf``
Diffstat (limited to 'tests/test_build_html.py')
-rw-r--r-- | tests/test_build_html.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_build_html.py b/tests/test_build_html.py index ceeb5f01c..5eaccb2bb 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -1245,3 +1245,21 @@ def test_html_remote_images(app, status, warning): assert ('<img alt="https://www.python.org/static/img/python-logo.png" ' 'src="https://www.python.org/static/img/python-logo.png" />' in result) assert not (app.outdir / 'python-logo.png').exists() + + +@pytest.mark.sphinx('html', testroot='basic') +def test_html_sidebar(app, status, warning): + app.builder.build_all() + result = (app.outdir / 'index.html').text(encoding='utf8') + assert '<h3><a href="#">Table Of Contents</a></h3>' in result + assert '<h3>Related Topics</h3>' in result + assert '<h3>This Page</h3>' in result + assert '<h3>Quick search</h3>' in result + + app.config.html_sidebars = {'**': []} + app.builder.build_all() + result = (app.outdir / 'index.html').text(encoding='utf8') + assert '<h3><a href="#">Table Of Contents</a></h3>' not in result + assert '<h3>Related Topics</h3>' not in result + assert '<h3>This Page</h3>' not in result + assert '<h3>Quick search</h3>' not in result |