Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_theme_api(app, status, warning):
cfg = app.config
themes = ['basic', 'default', 'scrolls', 'agogo', 'sphinxdoc', 'haiku',
'traditional', 'epub', 'nature', 'pyramid', 'bizstyle', 'classic', 'nonav',
'test-theme', 'ziptheme', 'staticfiles', 'parent', 'child']
if alabaster.version.__version_info__ >= (0, 7, 11):
themes.append('alabaster')
# test Theme class API
assert set(app.html_themes.keys()) == set(themes)
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
assert theme.name == 'ziptheme'
themedir = theme.themedir
assert theme.base.name == 'basic'
assert len(theme.get_theme_dirs()) == 2
# direct setting