Give failure one spelling
This commit is contained in:
@@ -8,7 +8,7 @@ import unittest
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
|
||||
|
||||
from loop_claude import claude_code, file_writes, judge, main, premises, transcript
|
||||
from loop_claude.outcome import Stop
|
||||
from loop_claude.outcome import Failure, Stop
|
||||
|
||||
CWD = pathlib.Path("/c")
|
||||
|
||||
@@ -58,12 +58,12 @@ class HumanTurns(unittest.TestCase):
|
||||
]), 3)
|
||||
|
||||
|
||||
class Said(unittest.TestCase):
|
||||
class PartLine(unittest.TestCase):
|
||||
def test_renders_text_and_tool_calls_and_nothing_else(self):
|
||||
self.assertEqual(transcript.said({"type": "text", "text": "hi"}), "hi")
|
||||
self.assertEqual(transcript.said({"type": "text", "text": " \n"}), "")
|
||||
self.assertEqual(transcript.said({"type": "tool_use", "name": "Bash", "input": {"command": "x" * 500}}, 20), '[tool Bash] {"command": "xxxxxxx')
|
||||
self.assertEqual(transcript.said("not a part"), "")
|
||||
self.assertEqual(transcript.part_line({"type": "text", "text": "hi"}), "hi")
|
||||
self.assertEqual(transcript.part_line({"type": "text", "text": " \n"}), "")
|
||||
self.assertEqual(transcript.part_line({"type": "tool_use", "name": "Bash", "input": {"command": "x" * 500}}, 20), '[tool Bash] {"command": "xxxxxxx')
|
||||
self.assertEqual(transcript.part_line("not a part"), "")
|
||||
|
||||
|
||||
class Parse(unittest.TestCase):
|
||||
@@ -103,7 +103,7 @@ class ReplaceFile(unittest.TestCase):
|
||||
def test_removes_what_it_staged_when_the_replace_fails(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
os.mkdir(os.path.join(root, "in-the-way"))
|
||||
self.assertIsInstance(file_writes.replace_file(os.path.join(root, "in-the-way"), b"data"), IsADirectoryError)
|
||||
self.assertEqual(file_writes.replace_file(os.path.join(root, "in-the-way"), b"data"), Failure("Is a directory"))
|
||||
self.assertEqual(os.listdir(root), ["in-the-way"])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user