Answer stability round 1: 0 🔴, 3 🟡 (0 misread); test the larv-review command table's stale-fetch refusals, --preloaded parsing and usage errors
CI / tests (pull_request) Successful in 2m43s
CI / tests (pull_request) Successful in 2m43s
This commit is contained in:
@@ -779,6 +779,41 @@ class LarvReviewTool(unittest.TestCase):
|
||||
self.assertFalse((self.checkout.parent / ".local" / "state" / "larv-review" / "proj" / "scoring").exists())
|
||||
self.assertEqual(len(self.git("worktree", "list").splitlines()), 1)
|
||||
|
||||
VALUES = {"AGENTS.md": "## Scoring run\n\n- Language: Python\n- Kind: a CLI\n- Domain: parsing\n- Domain docs: the spec\n- 3am question: the parse hangs\n"}
|
||||
|
||||
def test_prepare_scoring_puts_the_preloaded_text_it_is_given_in_the_seats_prompts(self):
|
||||
self.commit("Values", self.VALUES)
|
||||
prepared = self.run_tool("prepare-scoring", "--preloaded", "the files the harness loaded")
|
||||
self.assertEqual(prepared.returncode, 0, prepared.stderr)
|
||||
prompts = [path.read_text() for path in (self.checkout.parent / ".local" / "state" / "larv-review").rglob("*.md") if "scoring" in path.parts]
|
||||
self.assertTrue(any("the files the harness loaded" in prompt for prompt in prompts), prepared.stdout)
|
||||
|
||||
def test_prepare_scoring_refuses_a_preloaded_flag_without_its_text_and_any_other_arguments(self):
|
||||
self.commit("Values", self.VALUES)
|
||||
for given in (["--preloaded"], ["text"], ["text", "--preloaded"], ["--preloaded", "text", "more"], ["--other", "text"]):
|
||||
with self.subTest(given=given):
|
||||
ran = self.run_tool("prepare-scoring", *given)
|
||||
self.assertEqual((ran.returncode, ran.stdout), (1, ""))
|
||||
self.assertTrue(ran.stderr.startswith("unknown arguments prepare-scoring"), ran.stderr)
|
||||
|
||||
def test_record_scoring_without_a_scores_file_and_an_empty_item_ID_print_the_usage_line(self):
|
||||
bare = self.run_tool("record-scoring")
|
||||
self.assertEqual(bare.returncode, 1)
|
||||
self.assertTrue(bare.stderr.startswith("unknown arguments record-scoring; usage: larv-review "), bare.stderr)
|
||||
empty = self.run_tool("needs-scoring-run", "")
|
||||
self.assertEqual(empty.returncode, 1)
|
||||
self.assertIn("takes item IDs", empty.stderr)
|
||||
|
||||
def test_the_commands_that_judge_a_branch_refuse_a_failed_fetch_instead_of_reading_origin_as_last_fetched(self):
|
||||
self.git("remote", "set-url", "origin", str(self.checkout.parent / "gone.git"))
|
||||
seats = self.seats_file(f"PR #2 at {self.start}\n")
|
||||
for given in (["ruling-base"], ["needs-scoring-run"], ["needs-scoring-run", "1"], ["scoring-run-owed"], ["record-scoring", seats], ["record-scoring", seats, "1"]):
|
||||
with self.subTest(given=given):
|
||||
ran = self.run_tool(*given)
|
||||
self.assertEqual(ran.returncode, 1)
|
||||
self.assertNotIn("reading origin as last fetched", ran.stderr)
|
||||
self.assertEqual(ran.stdout, "")
|
||||
|
||||
def test_reports_a_plan_it_cannot_read_yet_keeps_the_run(self):
|
||||
# This checkout has no README.md beside its todo.md.
|
||||
ran = self.record_sevens()
|
||||
|
||||
Reference in New Issue
Block a user