From 97782c8ba1b17e218b68c4cee39a89b84efe4b56 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Thu, 3 Jan 2019 21:04:53 +0900 Subject: [PATCH] Separate testcase for html_style to single case from root --- tests/roots/test-html_style/_static/default.css | 0 tests/roots/test-html_style/conf.py | 2 ++ tests/roots/test-html_style/contents.rst | 2 ++ tests/roots/test-root/conf.py | 1 - tests/test_build_html.py | 9 +++++++++ 5 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/roots/test-html_style/_static/default.css create mode 100644 tests/roots/test-html_style/conf.py create mode 100644 tests/roots/test-html_style/contents.rst diff --git a/tests/roots/test-html_style/_static/default.css b/tests/roots/test-html_style/_static/default.css new file mode 100644 index 000000000..e69de29bb diff --git a/tests/roots/test-html_style/conf.py b/tests/roots/test-html_style/conf.py new file mode 100644 index 000000000..df1b3103c --- /dev/null +++ b/tests/roots/test-html_style/conf.py @@ -0,0 +1,2 @@ +html_style = 'default.css' +html_static_path = ['_static'] diff --git a/tests/roots/test-html_style/contents.rst b/tests/roots/test-html_style/contents.rst new file mode 100644 index 000000000..d8aef481c --- /dev/null +++ b/tests/roots/test-html_style/contents.rst @@ -0,0 +1,2 @@ +html_style +========== diff --git a/tests/roots/test-root/conf.py b/tests/roots/test-root/conf.py index d5029a776..7e00d1fb7 100644 --- a/tests/roots/test-root/conf.py +++ b/tests/roots/test-root/conf.py @@ -39,7 +39,6 @@ html_sidebars = {'**': ['localtoc.html', 'relations.html', 'sourcelink.html', 'customsb.html', 'searchbox.html'], 'contents': ['contentssb.html', 'localtoc.html', 'globaltoc.html']} -html_style = 'default.css' html_last_updated_fmt = '%b %d, %Y' html_context = {'hckey': 'hcval', 'hckey_co': 'wrong_hcval_co'} diff --git a/tests/test_build_html.py b/tests/test_build_html.py index 536992b1a..76c98959a 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -1258,6 +1258,15 @@ def test_alternate_stylesheets(app, cached_etree_parse, fname, expect): check_xpath(cached_etree_parse(app.outdir / fname), fname, *expect) +@pytest.mark.sphinx('html', testroot='html_style') +def test_html_style(app, status, warning): + app.build() + result = (app.outdir / 'contents.html').text() + assert '' in result + assert ('' + not in result) + + @pytest.mark.sphinx('html', testroot='images') def test_html_remote_images(app, status, warning): app.builder.build_all()