Test the digest's cuts, the median pick and gather's refusals, and drop project_rung's checkout parameter
This commit is contained in:
@@ -11,9 +11,9 @@ import unittest
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
||||
|
||||
from failure import Failure
|
||||
from task_bench import main
|
||||
from task_bench.gather import gather, PROMPT
|
||||
from test_env import isolated_env
|
||||
from task_bench import main
|
||||
|
||||
|
||||
class GatherTest(unittest.TestCase):
|
||||
@@ -80,6 +80,16 @@ class GatherTest(unittest.TestCase):
|
||||
self.assertEqual(found.reason.splitlines()[0] if isinstance(found, Failure) else found, "claude hit a usage limit: You've hit your session limit")
|
||||
self.assertTrue((self.bench / "digest.md").exists())
|
||||
|
||||
def test_a_digest_that_cannot_be_read_is_refused_with_the_reason(self):
|
||||
(self.bench / "digest.md").unlink()
|
||||
(self.bench / "digest.md").mkdir()
|
||||
found = gather(self.env, self.home, self.claude)
|
||||
self.assertEqual((found.reason if isinstance(found, Failure) else found, self.calls), (f"could not read {self.bench / 'digest.md'}: Is a directory", []))
|
||||
|
||||
def test_says_so_where_claude_ends_without_an_answer(self):
|
||||
self.reply["result"] = ""
|
||||
self.assertEqual(gather(self.env, self.home, self.claude)[0], "The gathering claude didn't say anything.")
|
||||
|
||||
def test_refuses_where_the_project_has_no_model_on_its_ladder(self):
|
||||
for saved, said in (({}, f"{self.models} names no model for calc: run loop-claude in the project once, which asks for it."), ({"calc": "claude-haiku-5-5"}, "calc runs on claude-haiku-5-5, which is not on its routing ladder.")):
|
||||
self.models.write_text(json.dumps(saved))
|
||||
|
||||
Reference in New Issue
Block a user