From 055b7f09c7af563b290a923f5a6e23ea22bffa93 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 22 May 2026 17:34:34 +0000 Subject: [PATCH] Stop pinning cli_real_flows assertion to live page text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pirate.github.io/stress-tests/challenge.html is a live URL whose contents can be edited at any time. The previous assertion required the exact title text "Browser-use Challenge for AI Browser Drivers" to appear in the wget output, which broke as soon as the page title was renamed (e.g. to "Browser Agent Challenge…"). Instead, verify the URL was fetched into its own wget snapshot directory with non-trivial HTML content. That still covers the actual invariant (wget archived the URL successfully) without coupling the test to page-content drift on an external site. --- archivebox/tests/test_cli_real_flows.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/archivebox/tests/test_cli_real_flows.py b/archivebox/tests/test_cli_real_flows.py index ee893713..874efe06 100644 --- a/archivebox/tests/test_cli_real_flows.py +++ b/archivebox/tests/test_cli_real_flows.py @@ -180,7 +180,13 @@ def test_cli_add_real_urls_with_options_writes_inspectable_outputs(tmp_path, pro combined_html = "\n".join(path.read_text(errors="ignore") for path in html_outputs) assert "Example Domain" in combined_html - assert "Browser-use Challenge for AI Browser Drivers" in combined_html + # Don't pin to exact page text — pirate.github.io/stress-tests/challenge.html + # can be edited at any time. Verify the URL was fetched into its own wget + # snapshot with non-trivial HTML content instead. + challenge_html_files = [p for p in html_outputs if "pirate.github.io" in str(p)] + assert challenge_html_files, f"No wget html output for challenge.html in {[str(p) for p in html_outputs]}" + assert any(p.stat().st_size > 1024 for p in challenge_html_files), \ + f"challenge.html wget output is empty/trivial: {[(str(p), p.stat().st_size) for p in challenge_html_files]}" assert processes assert any("wget" in (pwd or "") or "wget" in (cmd or "") for _type, _status, _exit, pwd, cmd in processes)