diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-01-03 21:04:53 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-02-03 19:16:04 +0900 |
| commit | 97782c8ba1b17e218b68c4cee39a89b84efe4b56 (patch) | |
| tree | bac8c8abc33517ce579cb631e5c694040636338d | |
| parent | 6b3244d679cfe3994ac941c2673195e5415757ab (diff) | |
| download | sphinx-git-97782c8ba1b17e218b68c4cee39a89b84efe4b56.tar.gz | |
Separate testcase for html_style to single case from root
| -rw-r--r-- | tests/roots/test-html_style/_static/default.css | 0 | ||||
| -rw-r--r-- | tests/roots/test-html_style/conf.py | 2 | ||||
| -rw-r--r-- | tests/roots/test-html_style/contents.rst | 2 | ||||
| -rw-r--r-- | tests/roots/test-root/conf.py | 1 | ||||
| -rw-r--r-- | tests/test_build_html.py | 9 |
5 files changed, 13 insertions, 1 deletions
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 --- /dev/null +++ b/tests/roots/test-html_style/_static/default.css 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 '<link rel="stylesheet" href="_static/default.css" type="text/css" />' in result + assert ('<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />' + not in result) + + @pytest.mark.sphinx('html', testroot='images') def test_html_remote_images(app, status, warning): app.builder.build_all() |
