Pin the judge's rules, the interrupt's checkout root, no name on resume, and a failed replace leaving nothing staged
This commit is contained in:
+11
-1
@@ -1,11 +1,13 @@
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
|
||||
|
||||
from loop_claude import judge, main, premises, transcript
|
||||
from loop_claude import file_writes, judge, main, premises, transcript
|
||||
from loop_claude.outcome import Stop
|
||||
|
||||
CWD = pathlib.Path("/c")
|
||||
@@ -95,5 +97,13 @@ class LoopState(unittest.TestCase):
|
||||
|
||||
|
||||
|
||||
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(os.listdir(root), ["in-the-way"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user