Merge pull request #6449 from tk0miya/6444_non_existing_urls

Fix #6444: test: replace example.com by existing page
This commit is contained in:
Takeshi KOMIYA 2019-06-19 11:19:23 +09:00 committed by GitHub
commit efc0c19142
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 22 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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')

View File

@ -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/}'

View File

@ -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()

View File

@ -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', '.'],

View File

@ -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