mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-14 16:44:59 +00:00
fix: Remove unused mock_stdout in test_main
This commit is contained in:
parent
1953c9815a
commit
0ac6068e1d
1 changed files with 20 additions and 22 deletions
|
@ -180,16 +180,15 @@ class TestMain(TestCase):
|
|||
self.assertNotIn(abs_ignored_file, coder.abs_fnames)
|
||||
|
||||
# Test with --add-gitignore-files set to True
|
||||
with patch("sys.stdout", new_callable=StringIO) as mock_stdout:
|
||||
coder = main(
|
||||
["--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 in the chat
|
||||
self.assertIn(abs_ignored_file, coder.abs_fnames)
|
||||
coder = main(
|
||||
["--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 in the chat
|
||||
self.assertIn(abs_ignored_file, coder.abs_fnames)
|
||||
|
||||
# Test with --add-gitignore-files set to False
|
||||
coder = main(
|
||||
|
@ -235,19 +234,18 @@ class TestMain(TestCase):
|
|||
self.assertNotIn(abs_ignored_file, coder.abs_fnames)
|
||||
|
||||
# Test with --add-gitignore-files set to True
|
||||
with patch("sys.stdout", new_callable=StringIO) as mock_stdout:
|
||||
coder = main(
|
||||
["--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)
|
||||
coder = main(
|
||||
["--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)
|
||||
|
||||
# Verify the ignored file is in the chat
|
||||
self.assertIn(abs_ignored_file, coder.abs_fnames)
|
||||
# Verify the ignored file is in the chat
|
||||
self.assertIn(abs_ignored_file, coder.abs_fnames)
|
||||
|
||||
# Test with --add-gitignore-files set to False
|
||||
coder = main(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue