mirror of
https://github.com/Aider-AI/aider
synced 2026-04-25 17:15:07 +02:00
fix: Remove unused mock_stdout in tests
This commit is contained in:
@@ -192,16 +192,15 @@ class TestMain(TestCase):
|
||||
self.assertIn(abs_ignored_file, coder.abs_fnames)
|
||||
|
||||
# Test with --add-gitignore-files set to False
|
||||
with patch("sys.stdout", new_callable=StringIO) as mock_stdout:
|
||||
coder = main(
|
||||
["--no-add-gitignore-files", "--exit", "--yes", abs_ignored_file],
|
||||
input=DummyInput(),
|
||||
output=DummyOutput(),
|
||||
return_coder=True,
|
||||
force_git_root=git_dir,
|
||||
)
|
||||
# Verify the ignored file is not in the chat
|
||||
self.assertNotIn(abs_ignored_file, coder.abs_fnames)
|
||||
coder = main(
|
||||
["--no-add-gitignore-files", "--exit", "--yes", abs_ignored_file],
|
||||
input=DummyInput(),
|
||||
output=DummyOutput(),
|
||||
return_coder=True,
|
||||
force_git_root=git_dir,
|
||||
)
|
||||
# Verify the ignored file is not in the chat
|
||||
self.assertNotIn(abs_ignored_file, coder.abs_fnames)
|
||||
|
||||
def test_add_command_gitignore_files_flag(self):
|
||||
with GitTemporaryDirectory() as git_dir:
|
||||
@@ -251,20 +250,19 @@ class TestMain(TestCase):
|
||||
self.assertIn(abs_ignored_file, coder.abs_fnames)
|
||||
|
||||
# Test with --add-gitignore-files set to False
|
||||
with patch("sys.stdout", new_callable=StringIO) as mock_stdout:
|
||||
coder = main(
|
||||
["--no-add-gitignore-files", "--exit", "--yes"],
|
||||
input=DummyInput(),
|
||||
output=DummyOutput(),
|
||||
return_coder=True,
|
||||
force_git_root=git_dir,
|
||||
)
|
||||
coder = main(
|
||||
["--no-add-gitignore-files", "--exit", "--yes"],
|
||||
input=DummyInput(),
|
||||
output=DummyOutput(),
|
||||
return_coder=True,
|
||||
force_git_root=git_dir,
|
||||
)
|
||||
|
||||
with patch.object(coder.io, "confirm_ask", return_value=True):
|
||||
coder.commands.cmd_add(rel_ignored_file)
|
||||
with patch.object(coder.io, "confirm_ask", return_value=True):
|
||||
coder.commands.cmd_add(rel_ignored_file)
|
||||
|
||||
# Verify the ignored file is not in the chat
|
||||
self.assertNotIn(abs_ignored_file, coder.abs_fnames)
|
||||
# Verify the ignored file is not in the chat
|
||||
self.assertNotIn(abs_ignored_file, coder.abs_fnames)
|
||||
|
||||
def test_main_args(self):
|
||||
with patch("aider.coders.Coder.create") as MockCoder:
|
||||
|
||||
Reference in New Issue
Block a user