diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-04-22 10:08:06 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-22 10:08:06 +0900 |
commit | 45887c7d62dde461f2741f1cb9e2cc1ca26a42dd (patch) | |
tree | 00e8a3e1bf94d23f0d87d3f70b9cbf0b96c16dae /tests/test_build_html.py | |
parent | 7846a4a68f5c657fa8ad3dbe5ab88e2c6ce992fe (diff) | |
parent | 9ad4c9125fe47602eace18e555eb4eedf0649c2a (diff) | |
download | sphinx-git-45887c7d62dde461f2741f1cb9e2cc1ca26a42dd.tar.gz |
Merge pull request #3589 from tk0miya/support_remote_images
Support remote images
Diffstat (limited to 'tests/test_build_html.py')
-rw-r--r-- | tests/test_build_html.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test_build_html.py b/tests/test_build_html.py index ad4c29dcb..9265caed4 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -32,7 +32,6 @@ WARNING: Explicit markup ends without a blank line; unexpected unindent. %(root)s/index.rst:\\d+: WARNING: Encoding 'utf-8-sig' used for reading included \ file u'%(root)s/wrongenc.inc' seems to be wrong, try giving an :encoding: option %(root)s/index.rst:\\d+: WARNING: image file not readable: foo.png -%(root)s/index.rst:\\d+: WARNING: nonlocal image URI found: http://www.python.org/logo.png %(root)s/index.rst:\\d+: WARNING: download file not readable: %(root)s/nonexisting.png %(root)s/index.rst:\\d+: WARNING: invalid single index entry u'' %(root)s/undecodable.rst:\\d+: WARNING: undecodable source characters, replacing \ @@ -1224,3 +1223,13 @@ def test_html_raw_directive(app, status, warning): def test_alternate_stylesheets(app, cached_etree_parse, fname, expect): app.build() check_xpath(cached_etree_parse(app.outdir / fname), fname, *expect) + + +@pytest.mark.sphinx('html', testroot='images') +def test_html_remote_images(app, status, warning): + app.builder.build_all() + + result = (app.outdir / 'index.html').text(encoding='utf8') + assert ('<img alt="https://www.python.org/static/img/python-logo.png" ' + 'src="https://www.python.org/static/img/python-logo.png" />' in result) + assert not (app.outdir / 'python-logo.png').exists() |