From f5cbb0088d669ae893d27df1070edacc761c8e4f Mon Sep 17 00:00:00 2001 From: Foothills Digital Date: Fri, 6 Nov 2026 08:15:03 -0700 Subject: [PATCH] test(reports): cover a hide whose entry left the list while queued --- scripts/tests/test_reports.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/tests/test_reports.py b/scripts/tests/test_reports.py index 62056ce..fbcb59d 100644 --- a/scripts/tests/test_reports.py +++ b/scripts/tests/test_reports.py @@ -525,6 +525,15 @@ def test_hide_pr_touches_only_entries(self): self.assertEqual(main(["apply", "--result", result, "--entries", path]), 0) self.assertEqual("".join(c.args[0] for c in out.write.call_args_list).strip(), "") + # Gone from fresh main while the job queued: fail without a branch or a write. + save([entry("zed/zed")], path) + before = open(path, encoding="utf-8").read() + with mock.patch("sys.stdout") as out, mock.patch("sys.stderr") as err: + self.assertEqual(main(["apply", "--result", result, "--entries", path]), 1) + self.assertEqual("".join(c.args[0] for c in out.write.call_args_list), "") + self.assertIn("alice/tool is no longer on the list", "".join(c.args[0] for c in err.write.call_args_list)) + self.assertEqual(open(path, encoding="utf-8").read(), before) + # The workflow commits entries.json and nothing else, so auto-approve accepts the PR. text = WORKFLOW.read_text() self.assertIn("git add data/entries.json\n", text)