Test the forge runner's folder and timeout message, and the loop's forge effect
CI / tests (pull_request) Has been cancelled
CI / tests (pull_request) Has been cancelled
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import itertools
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import sys
|
||||
import tempfile
|
||||
import typing
|
||||
import unittest
|
||||
|
||||
@@ -170,7 +172,9 @@ class Runner(unittest.TestCase):
|
||||
failed = runner("/")(["no-such-forge-cli", "pr", "list"])
|
||||
self.assertIsInstance(failed, Failure)
|
||||
self.assertTrue(failed.reason.startswith("no-such-forge-cli could not start: "), failed.reason)
|
||||
self.assertEqual(runner("/", 0.05)(["sleep", "5"]), Failure("sleep 5: stopped after 0.05 s"))
|
||||
self.assertEqual(runner("/", 0.05)(["sh", "-c", "sleep 5", "later"]), Failure("sh -c sleep 5: stopped after 0.05 s"))
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
self.assertEqual(runner(folder)(["pwd", "-P"]), os.path.realpath(folder) + "\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -99,6 +99,12 @@ class ClaudeOnTerminal(unittest.TestCase):
|
||||
|
||||
|
||||
|
||||
class ForgeEffect(unittest.TestCase):
|
||||
def test_runs_the_forges_cli_in_the_checkout_it_is_given(self):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
self.assertEqual(system_effects(pathlib.Path.home(), os.environ).forge(folder)(["pwd", "-P"]), os.path.realpath(folder) + "\n")
|
||||
|
||||
|
||||
class TmuxEffect(unittest.TestCase):
|
||||
"""Each test runs a fake tmux off its own PATH, without $TMUX, so the human's tmux server is never reached."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user