mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #6449 from tk0miya/6444_non_existing_urls
Fix #6444: test: replace example.com by existing page
This commit is contained in:
commit
efc0c19142
@ -26,4 +26,4 @@ test-image
|
||||
.. image:: https://www.python.org/static/img/python-logo.png
|
||||
|
||||
.. non-exist remote image
|
||||
.. image:: http://example.com/NOT_EXIST.PNG
|
||||
.. image:: https://www.google.com/NOT_EXIST.PNG
|
||||
|
@ -23,8 +23,8 @@ link to external1_ and external2_.
|
||||
|
||||
link to `Sphinx Site <http://sphinx-doc.org>`_ and `Python Site <http://python.org>`_.
|
||||
|
||||
.. _external1: http://example.com/external1
|
||||
.. _external2: http://example.com/external2
|
||||
.. _external1: https://www.google.com/external1
|
||||
.. _external2: https://www.google.com/external2
|
||||
|
||||
|
||||
Multiple references in the same line
|
||||
|
@ -6,11 +6,11 @@ This is from CPython documentation.
|
||||
|
||||
Some additional anchors to exercise ignore code
|
||||
|
||||
* `Example Bar invalid <http://example.com/#!bar>`_
|
||||
* `Example Bar invalid <http://example.com#!bar>`_ tests that default ignore anchor of #! does not need to be prefixed with /
|
||||
* `Example Bar invalid <http://example.com/#top>`_
|
||||
* `Example Bar invalid <https://www.google.com/#!bar>`_
|
||||
* `Example Bar invalid <https://www.google.com#!bar>`_ tests that default ignore anchor of #! does not need to be prefixed with /
|
||||
* `Example Bar invalid <https://www.google.com/#top>`_
|
||||
* `Example anchor invalid <http://www.sphinx-doc.org/en/1.7/intro.html#does-not-exist>`_
|
||||
* `Complete nonsense <https://localhost:7777/doesnotexist>`_
|
||||
|
||||
.. image:: http://example.com/image.png
|
||||
.. figure:: http://example.com/image2.png
|
||||
.. image:: https://www.google.com/image.png
|
||||
.. figure:: https://www.google.com/image2.png
|
||||
|
@ -1240,25 +1240,25 @@ def test_html_entity(app):
|
||||
def test_html_inventory(app):
|
||||
app.builder.build_all()
|
||||
with open(app.outdir / 'objects.inv', 'rb') as f:
|
||||
invdata = InventoryFile.load(f, 'http://example.com', os.path.join)
|
||||
invdata = InventoryFile.load(f, 'https://www.google.com', os.path.join)
|
||||
assert set(invdata.keys()) == {'std:label', 'std:doc'}
|
||||
assert set(invdata['std:label'].keys()) == {'modindex', 'genindex', 'search'}
|
||||
assert invdata['std:label']['modindex'] == ('Python',
|
||||
'',
|
||||
'http://example.com/py-modindex.html',
|
||||
'https://www.google.com/py-modindex.html',
|
||||
'Module Index')
|
||||
assert invdata['std:label']['genindex'] == ('Python',
|
||||
'',
|
||||
'http://example.com/genindex.html',
|
||||
'https://www.google.com/genindex.html',
|
||||
'Index')
|
||||
assert invdata['std:label']['search'] == ('Python',
|
||||
'',
|
||||
'http://example.com/search.html',
|
||||
'https://www.google.com/search.html',
|
||||
'Search Page')
|
||||
assert set(invdata['std:doc'].keys()) == {'index'}
|
||||
assert invdata['std:doc']['index'] == ('Python',
|
||||
'',
|
||||
'http://example.com/index.html',
|
||||
'https://www.google.com/index.html',
|
||||
'The basic Sphinx documentation for testing')
|
||||
|
||||
|
||||
|
@ -1242,7 +1242,7 @@ def test_latex_images(app, status, warning):
|
||||
# not found images
|
||||
assert '\\sphinxincludegraphics{{NOT_EXIST}.PNG}' not in result
|
||||
assert ('WARNING: Could not fetch remote image: '
|
||||
'http://example.com/NOT_EXIST.PNG [404]' in warning.getvalue())
|
||||
'https://www.google.com/NOT_EXIST.PNG [404]' in warning.getvalue())
|
||||
|
||||
# an image having target
|
||||
assert ('\\sphinxhref{https://www.sphinx-doc.org/}'
|
||||
|
@ -25,8 +25,8 @@ def test_defaults(app, status, warning):
|
||||
# looking for non-existent URL should fail
|
||||
assert " Max retries exceeded with url: /doesnotexist" in content
|
||||
# images should fail
|
||||
assert "Not Found for url: http://example.com/image.png" in content
|
||||
assert "Not Found for url: http://example.com/image2.png" in content
|
||||
assert "Not Found for url: https://www.google.com/image.png" in content
|
||||
assert "Not Found for url: https://www.google.com/image2.png" in content
|
||||
assert len(content.splitlines()) == 5
|
||||
|
||||
|
||||
@ -36,8 +36,8 @@ def test_defaults(app, status, warning):
|
||||
'linkcheck_ignore': [
|
||||
'https://localhost:7777/doesnotexist',
|
||||
'http://www.sphinx-doc.org/en/1.7/intro.html#',
|
||||
'http://example.com/image.png',
|
||||
'http://example.com/image2.png']
|
||||
'https://www.google.com/image.png',
|
||||
'https://www.google.com/image2.png']
|
||||
})
|
||||
def test_anchors_ignored(app, status, warning):
|
||||
app.builder.build_all()
|
||||
|
@ -885,8 +885,8 @@ def test_xml_keep_external_links(app):
|
||||
assert_elem(
|
||||
para1[0],
|
||||
['LINK TO', 'external2', 'AND', 'external1', '.'],
|
||||
['http://example.com/external2',
|
||||
'http://example.com/external1'])
|
||||
['https://www.google.com/external2',
|
||||
'https://www.google.com/external1'])
|
||||
assert_elem(
|
||||
para1[1],
|
||||
['LINK TO', 'THE PYTHON SITE', 'AND', 'THE SPHINX SITE', '.'],
|
||||
|
@ -279,9 +279,9 @@ def get_verifier(verify, verify_re):
|
||||
(
|
||||
# in URIs
|
||||
'verify_re',
|
||||
'`test <http://example.com/~me/>`_',
|
||||
'`test <https://www.google.com/~me/>`_',
|
||||
None,
|
||||
r'\\sphinxhref{http://example.com/~me/}{test}.*',
|
||||
r'\\sphinxhref{https://www.google.com/~me/}{test}.*',
|
||||
),
|
||||
(
|
||||
# description list: simple
|
||||
|
Loading…
Reference in New Issue
Block a user