mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-11-02 20:30:30 -06:00
Merge branch 'stable'
This commit is contained in:
commit
5bc5b8f013
21 files changed
+63
-71
No files matched your search
+20
-3
@@ -17,6 +17,7 @@ from sphinx.theming import ThemeError
|
||||
|
||||
|
||||
@pytest.mark.sphinx(
|
||||
testroot='theming',
|
||||
confoverrides={'html_theme': 'ziptheme',
|
||||
'html_theme_options.testopt': 'foo'})
|
||||
def test_theme_api(app, status, warning):
|
||||
@@ -25,10 +26,11 @@ def test_theme_api(app, status, warning):
|
||||
# test Theme class API
|
||||
assert set(app.html_themes.keys()) == \
|
||||
set(['basic', 'default', 'scrolls', 'agogo', 'sphinxdoc', 'haiku',
|
||||
'traditional', 'testtheme', 'ziptheme', 'epub', 'nature',
|
||||
'pyramid', 'bizstyle', 'classic', 'nonav'])
|
||||
assert app.html_themes['testtheme'] == app.srcdir / 'testtheme'
|
||||
'traditional', 'epub', 'nature', 'pyramid', 'bizstyle', 'classic', 'nonav',
|
||||
'test-theme', 'ziptheme', 'staticfiles', 'parent', 'child'])
|
||||
assert app.html_themes['test-theme'] == app.srcdir / 'test_theme' / 'test-theme'
|
||||
assert app.html_themes['ziptheme'] == app.srcdir / 'ziptheme.zip'
|
||||
assert app.html_themes['staticfiles'] == app.srcdir / 'test_theme' / 'staticfiles'
|
||||
|
||||
# test Theme instance API
|
||||
theme = app.builder.theme
|
||||
@@ -97,6 +99,21 @@ def test_nested_zipped_theme(app, status, warning):
|
||||
app.build() # => not raises TemplateNotFound
|
||||
|
||||
|
||||
@pytest.mark.sphinx(testroot='theming',
|
||||
confoverrides={'html_theme': 'staticfiles'})
|
||||
def test_staticfiles(app, status, warning):
|
||||
app.build()
|
||||
assert (app.outdir / '_static' / 'staticimg.png').exists()
|
||||
assert (app.outdir / '_static' / 'statictmpl.html').exists()
|
||||
assert (app.outdir / '_static' / 'statictmpl.html').text() == (
|
||||
'<!-- testing static templates -->\n'
|
||||
'<html><project>Python</project></html>'
|
||||
)
|
||||
|
||||
result = (app.outdir / 'index.html').text()
|
||||
assert '<meta name="testopt" content="optdefault" />' in result
|
||||
|
||||
|
||||
@pytest.mark.sphinx(testroot='theming')
|
||||
def test_theme_sidebars(app, status, warning):
|
||||
app.build()
|
||||
|
||||
Reference in new issue
Block a user