diff options
Diffstat (limited to 'tests/test_build_html.py')
-rw-r--r-- | tests/test_build_html.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/test_build_html.py b/tests/test_build_html.py index bbfd0bc90..2b45720d1 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -186,7 +186,6 @@ def test_html_warnings(app, warning): (".//dd/p", r'Return spam\.'), ], 'extapi.html': [ - (".//strong", 'from function: Foo'), (".//strong", 'from class: Bar'), ], 'markup.html': [ @@ -1090,14 +1089,19 @@ def test_enumerable_node(app, cached_etree_parse, fname, expect): def test_html_assets(app): app.builder.build_all() + # exclude_path and its family + assert not (app.outdir / 'static' / 'index.html').exists() + assert not (app.outdir / 'extra' / 'index.html').exists() + # html_static_path assert not (app.outdir / '_static' / '.htaccess').exists() assert not (app.outdir / '_static' / '.htpasswd').exists() assert (app.outdir / '_static' / 'API.html').exists() assert (app.outdir / '_static' / 'API.html').text() == 'Sphinx-1.4.4' - assert (app.outdir / '_static' / 'css/style.css').exists() + assert (app.outdir / '_static' / 'css' / 'style.css').exists() + assert (app.outdir / '_static' / 'js' / 'custom.js').exists() assert (app.outdir / '_static' / 'rimg.png').exists() - assert not (app.outdir / '_static' / '_build/index.html').exists() + assert not (app.outdir / '_static' / '_build' / 'index.html').exists() assert (app.outdir / '_static' / 'background.png').exists() assert not (app.outdir / '_static' / 'subdir' / '.htaccess').exists() assert not (app.outdir / '_static' / 'subdir' / '.htpasswd').exists() @@ -1108,11 +1112,17 @@ def test_html_assets(app): assert (app.outdir / 'API.html_t').exists() assert (app.outdir / 'css/style.css').exists() assert (app.outdir / 'rimg.png').exists() - assert not (app.outdir / '_build/index.html').exists() + assert not (app.outdir / '_build' / 'index.html').exists() assert (app.outdir / 'background.png').exists() assert (app.outdir / 'subdir' / '.htaccess').exists() assert not (app.outdir / 'subdir' / '.htpasswd').exists() + # html_css_files + content = (app.outdir / 'index.html').text() + assert '<link rel="stylesheet" type="text/css" href="_static/css/style.css" />' in content + assert ('<link media="print" rel="stylesheet" title="title" type="text/css" ' + 'href="https://example.com/custom.css" />' in content) + @pytest.mark.sphinx('html', testroot='basic', confoverrides={'html_copy_source': False}) def test_html_copy_source(app): |