summaryrefslogtreecommitdiff
path: root/tests/test_build_html.py
diff options
context:
space:
mode:
authorJean-François B <2589111+jfbu@users.noreply.github.com>2022-06-30 14:26:11 +0200
committerJean-François B <2589111+jfbu@users.noreply.github.com>2022-06-30 15:00:16 +0200
commit80198e82aa9174802cb1eb30d69ce7fe98e24399 (patch)
treeaa85c68296bd662543ccbcb17cc55e367e85c3c3 /tests/test_build_html.py
parentac0fc4b7817389fb8b860d82537f69d9060aabae (diff)
parentb9736f23484b16feef86208ab00dd947c54446ba (diff)
downloadsphinx-git-80198e82aa9174802cb1eb30d69ce7fe98e24399.tar.gz
Merge branch '5.x' into master
Resolved merge conflicts: sphinx/ext/extlinks.py sphinx/ext/napoleon/docstring.py (and removed from the latter a now unused import for flake8 F401 compliance)
Diffstat (limited to 'tests/test_build_html.py')
-rw-r--r--tests/test_build_html.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index cb036a1af..ff72b0aac 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -1732,6 +1732,8 @@ def test_option_emphasise_placeholders(app, status, warning):
'<span class="pre">-</span>'
'<em><span class="pre">COUNT</span></em>' in content)
assert '<span class="pre">{{value}}</span>' in content
+ assert ('<span class="pre">--plugin.option</span></span>'
+ '<a class="headerlink" href="#cmdoption-perl-plugin.option" title="Permalink to this definition">¶</a></dt>') in content
@pytest.mark.sphinx('html', testroot='root')
@@ -1741,3 +1743,26 @@ def test_option_emphasise_placeholders_default(app, status, warning):
assert '<span class="pre">={TYPE}</span>' in content
assert '<span class="pre">={WHERE}-{COUNT}</span></span>' in content
assert '<span class="pre">{client_name}</span>' in content
+ assert ('<span class="pre">--plugin.option</span></span>'
+ '<span class="sig-prename descclassname"></span>'
+ '<a class="headerlink" href="#cmdoption-perl-plugin.option" title="Permalink to this definition">¶</a></dt>') in content
+
+
+@pytest.mark.sphinx('html', testroot='theming')
+def test_theme_options(app, status, warning):
+ app.build()
+
+ result = (app.outdir / '_static' / 'documentation_options.js').read_text(encoding='utf8')
+ assert 'NAVIGATION_WITH_KEYS: false' in result
+ assert 'ENABLE_SEARCH_SHORTCUTS: true' in result
+
+
+@pytest.mark.sphinx('html', testroot='theming',
+ confoverrides={'html_theme_options.navigation_with_keys': True,
+ 'html_theme_options.enable_search_shortcuts': False})
+def test_theme_options_with_override(app, status, warning):
+ app.build()
+
+ result = (app.outdir / '_static' / 'documentation_options.js').read_text(encoding='utf8')
+ assert 'NAVIGATION_WITH_KEYS: true' in result
+ assert 'ENABLE_SEARCH_SHORTCUTS: false' in result