mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +00:00
aider: Removed all the save_stdin
stuff.
# Context: USER: remove all the save_stdin stuff ASSISTANT: ```python tests/test_main.py <<<<<<< ORIGINAL save_stdin = sys.stdin sys.stdin = pipe_input main([], input=pipe_input, output=DummyOutput()) sys.stdin = save_stdin ======= main([], input=pipe_input, output=DummyOutput()) >>>>>>> UPDATED ``` ```python tests/test_main.py <<<<<<< ORIGINAL save_stdin = sys.stdin sys.stdin = pipe_input main(["foo.txt"], input=pipe_input, output=DummyOutput()) sys.stdin = save_stdin ======= main(["foo.txt"], input=pipe_input, output=DummyOutput()) >>>>>>> UPDATED ``` ```python tests/test_main.py <<<<<<< ORIGINAL save_stdin = sys.stdin sys.stdin = pipe_input main(["--yes", "foo.txt"], input=pipe_input, output=DummyOutput()) sys.stdin = save_stdin ======= main(["--yes", "foo.txt"], input=pipe_input, output=DummyOutput()) >>>>>>> UPDATED ```
This commit is contained in:
parent
2e53e59cf3
commit
de69a3095a
1 changed files with 0 additions and 9 deletions
|
@ -14,20 +14,14 @@ class TestMain(TestCase):
|
|||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
os.chdir(temp_dir)
|
||||
pipe_input = create_input(StringIO(''))
|
||||
save_stdin = sys.stdin
|
||||
sys.stdin = pipe_input
|
||||
main([], input=pipe_input, output=DummyOutput())
|
||||
sys.stdin = save_stdin
|
||||
pipe_input.close()
|
||||
|
||||
def test_main_with_empty_dir_new_file(self):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
os.chdir(temp_dir)
|
||||
pipe_input = create_input(StringIO(''))
|
||||
save_stdin = sys.stdin
|
||||
sys.stdin = pipe_input
|
||||
main(["foo.txt"], input=pipe_input, output=DummyOutput())
|
||||
sys.stdin = save_stdin
|
||||
pipe_input.close()
|
||||
self.assertTrue(os.path.exists("foo.txt"))
|
||||
|
||||
|
@ -36,9 +30,6 @@ class TestMain(TestCase):
|
|||
os.chdir(temp_dir)
|
||||
subprocess.run(["git", "init"], cwd=temp_dir)
|
||||
pipe_input = create_input(StringIO(''))
|
||||
save_stdin = sys.stdin
|
||||
sys.stdin = pipe_input
|
||||
main(["--yes", "foo.txt"], input=pipe_input, output=DummyOutput())
|
||||
sys.stdin = save_stdin
|
||||
pipe_input.close()
|
||||
self.assertTrue(os.path.exists("foo.txt"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue