summaryrefslogtreecommitdiffstats
path: root/tests/test_theming/test_html_theme.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 16:20:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 16:20:58 +0000
commitffcb4b87846b4e4a2d9eee8df4b7ec40365878b8 (patch)
tree3c64877dd20ad1141111c77b3463e95686002b39 /tests/test_theming/test_html_theme.py
parentAdding debian version 7.2.6-8. (diff)
downloadsphinx-ffcb4b87846b4e4a2d9eee8df4b7ec40365878b8.tar.xz
sphinx-ffcb4b87846b4e4a2d9eee8df4b7ec40365878b8.zip
Merging upstream version 7.3.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_theming/test_html_theme.py')
-rw-r--r--tests/test_theming/test_html_theme.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/test_theming/test_html_theme.py b/tests/test_theming/test_html_theme.py
new file mode 100644
index 0000000..e9a183f
--- /dev/null
+++ b/tests/test_theming/test_html_theme.py
@@ -0,0 +1,35 @@
+import pytest
+
+
+@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
+
+
+@pytest.mark.sphinx('html', testroot='build-html-theme-having-multiple-stylesheets')
+def test_theme_having_multiple_stylesheets(app):
+ app.build()
+ content = (app.outdir / 'index.html').read_text(encoding='utf-8')
+
+ assert '<link rel="stylesheet" type="text/css" href="_static/mytheme.css" />' in content
+ assert '<link rel="stylesheet" type="text/css" href="_static/extra.css" />' in content