failing test for linkcheck of US Patent page

This commit is contained in:
Justin Mathews 2021-06-07 13:57:15 -04:00
parent de64bfdeac
commit 84d4a5b97a
3 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1 @@
exclude_patterns = ['_build']

View File

@ -0,0 +1 @@
This is `a link to the US Patent Website <https://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&p=1&u=%2Fnetahtml%2FPTO%2Fsearch-bool.html&r=1&f=G&l=50&co1=AND&d=PTXT&s1=7840660&OS=7840660&RS=7840660>`_

View File

@ -575,3 +575,20 @@ def test_limit_rate_bails_out_after_waiting_max_time(app):
rate_limits)
next_check = worker.limit_rate(FakeResponse())
assert next_check is None
@pytest.mark.sphinx('linkcheck', testroot='linkcheck-connection-error-on-http-head', freshenv=True)
def test_get_after_head_raises_connection_error(app):
class InternalServerErrorHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_error(500, "Internal Server Error")
with http_server(InternalServerErrorHandler):
app.build()
content = (app.outdir / 'output.txt').read_text()
assert "broken" not in content
# assert content == (
# "index.rst:1: [broken] http://localhost:7777/#anchor: "
# "500 Server Error: Internal Server Error "
# "for url: http://localhost:7777/\n"
# )