From 7894b5a2698c6abf4d285da78409785c40eab7b2 Mon Sep 17 00:00:00 2001 From: James Addison <55152140+jayaddison@users.noreply.github.com> Date: Mon, 18 Mar 2024 17:36:22 +0000 Subject: [PATCH] [tests] linkcheck: add test coverage for behaviour of a locally-existing file. (#12128) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- tests/test_builders/test_build_linkcheck.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_builders/test_build_linkcheck.py b/tests/test_builders/test_build_linkcheck.py index a65be6c82..c630b700e 100644 --- a/tests/test_builders/test_build_linkcheck.py +++ b/tests/test_builders/test_build_linkcheck.py @@ -116,7 +116,7 @@ def test_defaults(app): # images should fail assert "Not Found for url: http://localhost:7777/image.png" in content assert "Not Found for url: http://localhost:7777/image2.png" in content - # looking for local file should fail + # looking for missing local file should fail assert "[broken] path/to/notfound" in content assert len(content.splitlines()) == 5 @@ -134,6 +134,8 @@ def test_defaults(app): # the output order of the rows is not stable # due to possible variance in network latency rowsby = {row["uri"]: row for row in rows} + # looking for local file that exists should succeed + assert rowsby["conf.py"]["status"] == "working" assert rowsby["http://localhost:7777#!bar"] == { 'filename': 'links.rst', 'lineno': 5,