Test the median pick by tokens, the name of a silent claude and the environment git runs in
CI / tests (pull_request) Successful in 4m13s
CI / tests (pull_request) Successful in 4m13s
This commit is contained in:
@@ -98,6 +98,18 @@ class GatherTest(unittest.TestCase):
|
||||
self.models.write_text("{")
|
||||
self.assertIsInstance(gather(self.env, self.home, self.claude), Failure)
|
||||
|
||||
def test_a_claude_that_fails_without_a_word_is_named(self):
|
||||
self.code = 1
|
||||
found = gather(self.env, self.home, lambda args, cwd, prompt: subprocess.CompletedProcess(args, 1, "", ""))
|
||||
self.assertEqual(found.reason.splitlines()[0] if isinstance(found, Failure) else found, "the gathering claude exited 1")
|
||||
|
||||
def test_git_runs_in_the_environment_given(self):
|
||||
env = {**self.env, "GIT_DIR": str(self.home / "none")}
|
||||
self.assertIsInstance(gather(env, self.home, self.claude), Failure)
|
||||
with contextlib.redirect_stderr(io.StringIO()):
|
||||
self.assertEqual(main.main(["gather"], env, claude=self.claude), 1)
|
||||
self.assertEqual(self.calls, [])
|
||||
|
||||
def test_refuses_outside_a_checkout(self):
|
||||
with contextlib.chdir(self.home):
|
||||
self.assertIsInstance(gather(self.env, self.home, self.claude), Failure)
|
||||
|
||||
Reference in New Issue
Block a user