Answer principles round 1: 1 🔴, 7 🟡 (0 misread); every effect is handed in as an argument, no test patches a global, and the traces principle scopes tools that run on their user's machine
CI / tests (pull_request) Successful in 3m43s
CI / tests (pull_request) Successful in 3m43s
This commit is contained in:
@@ -179,6 +179,20 @@ class TheCommand(DoEpicTest):
|
||||
|
||||
|
||||
class ACycleOfAChunkWithoutARepo(DoEpicTest):
|
||||
def test_naming_the_chunks_folder_doesnt_make_it(self) -> None:
|
||||
folder = self.home / ".local/state/do-epic/ABC-12"
|
||||
self.assertEqual(main.chunk_root("ABC-21", self.issues[1], self.epic_run(FakeEffects())), (str(folder), None))
|
||||
self.assertFalse(folder.exists())
|
||||
self.assertIsNone(main.folder_made(str(folder)))
|
||||
self.assertTrue(folder.is_dir())
|
||||
|
||||
def test_a_chunk_whose_folder_cannot_be_made_stops_with_the_reason(self) -> None:
|
||||
(self.home / ".local/state").mkdir(parents=True, exist_ok=True)
|
||||
(self.home / ".local/state/do-epic").write_text("", encoding="utf-8")
|
||||
code, _, err = self.run_main(["--chunk", "ABC-21", "ABC-12"], FakeEffects(), {"TMUX_PANE": "%1"})
|
||||
self.assertEqual(code, 1)
|
||||
self.assertRegex(err, f"could not make the chunk's folder {self.home}/.local/state/do-epic/ABC-12: \\w")
|
||||
|
||||
def cycle(self, env: dict[str, str] | None = None) -> main.Cycle:
|
||||
fake = FakeEffects(git=[Failure("no git"), Failure("no git")])
|
||||
paths = paths_from(self.home)
|
||||
@@ -186,6 +200,7 @@ class ACycleOfAChunkWithoutARepo(DoEpicTest):
|
||||
place = main.chunk_root("ABC-21", self.issues[1], epic)
|
||||
assert isinstance(place, tuple)
|
||||
root, repo = place
|
||||
self.assertIsNone(main.folder_made(root))
|
||||
loop = Loop(root=root, session=main.session_named("A ABC-12 do-epic ABC-21", paths.claude_code_transcripts), window=tmux.Window("epic-ABC-12", "ABC-21", "%1"), paths=paths, env=env or {}, launcher=pathlib.Path("/b/do-epic"), effects=fake.effects())
|
||||
with contextlib.redirect_stdout(io.StringIO()):
|
||||
found = main.next_cycle(ChunkRun(1), loop, repo is not None, epic)
|
||||
|
||||
Reference in New Issue
Block a user