Pin an interrupt verdict without a question as incomplete, and one person in the empty-interrupt message
This commit is contained in:
@@ -278,7 +278,7 @@ class Interrupt(unittest.TestCase):
|
|||||||
unittest.mock.patch.multiple(interrupt, checkouts=unittest.mock.DEFAULT, trust=unittest.mock.DEFAULT) as mocks,
|
unittest.mock.patch.multiple(interrupt, checkouts=unittest.mock.DEFAULT, trust=unittest.mock.DEFAULT) as mocks,
|
||||||
unittest.mock.patch("subprocess.run") as run,
|
unittest.mock.patch("subprocess.run") as run,
|
||||||
):
|
):
|
||||||
self.assertEqual(interrupt.interrupt(root, SESSION_ID, "m", transcript, "q?", paths_from(pathlib.Path(root), {})), Stop(2, "the human is needed to answer the question above, but the interrupt ended without you typing anything"))
|
self.assertEqual(interrupt.interrupt(root, SESSION_ID, "m", transcript, "q?", paths_from(pathlib.Path(root), {})), Stop(2, "the human is needed to answer the question above, but the interrupt ended with nothing typed"))
|
||||||
mocks["checkouts"].assert_called_with(root)
|
mocks["checkouts"].assert_called_with(root)
|
||||||
self.assertEqual(run.call_args.kwargs["cwd"], root)
|
self.assertEqual(run.call_args.kwargs["cwd"], root)
|
||||||
self.assertEqual(run.call_args.args[0][run.call_args.args[0].index("--model") + 1], "m")
|
self.assertEqual(run.call_args.args[0][run.call_args.args[0].index("--model") + 1], "m")
|
||||||
@@ -352,6 +352,7 @@ class Verdict(unittest.TestCase):
|
|||||||
self.assertFalse(judge.complete({"interrupt": "no", "evidence": "", "finished": True, "question": ""}))
|
self.assertFalse(judge.complete({"interrupt": "no", "evidence": "", "finished": True, "question": ""}))
|
||||||
self.assertFalse(judge.complete({"interrupt": False, "evidence": None, "finished": True, "question": ""}))
|
self.assertFalse(judge.complete({"interrupt": False, "evidence": None, "finished": True, "question": ""}))
|
||||||
self.assertFalse(judge.complete({"interrupt": False}))
|
self.assertFalse(judge.complete({"interrupt": False}))
|
||||||
|
self.assertFalse(judge.complete({"interrupt": True, "evidence": "x", "finished": False, "question": " "}))
|
||||||
self.assertFalse(judge.complete(None))
|
self.assertFalse(judge.complete(None))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ class Interrupt(unittest.TestCase):
|
|||||||
transcript.unlink()
|
transcript.unlink()
|
||||||
run = checkout.run([*asked, interrupt()], terminal_input="")
|
run = checkout.run([*asked, interrupt()], terminal_input="")
|
||||||
self.assertEqual((run.code, run.roles()), (2, ["worker", "judge", "interrupt"]))
|
self.assertEqual((run.code, run.roles()), (2, ["worker", "judge", "interrupt"]))
|
||||||
self.assertEqual(run.stderr.strip().splitlines()[-1], "the human is needed to answer the question above, but the interrupt ended without you typing anything")
|
self.assertEqual(run.stderr.strip().splitlines()[-1], "the human is needed to answer the question above, but the interrupt ended with nothing typed")
|
||||||
|
|
||||||
run = checkout.run([worker(say="A or B?"), judge(interrupt=True, evidence="A or B?", question="A or B?", vanish=True)], terminal_input="")
|
run = checkout.run([worker(say="A or B?"), judge(interrupt=True, evidence="A or B?", question="A or B?", vanish=True)], terminal_input="")
|
||||||
self.assertEqual((run.code, run.roles()), (1, ["worker", "judge"]))
|
self.assertEqual((run.code, run.roles()), (1, ["worker", "judge"]))
|
||||||
|
|||||||
Reference in New Issue
Block a user