mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-15 00:54:59 +00:00
fix: Remove unused mock_stdout in tests
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
This commit is contained in:
parent
0ac6068e1d
commit
990a0566bb
1 changed files with 20 additions and 22 deletions
|
@ -168,16 +168,15 @@ class TestMain(TestCase):
|
||||||
abs_ignored_file = str(ignored_file.resolve())
|
abs_ignored_file = str(ignored_file.resolve())
|
||||||
|
|
||||||
# Test without the --add-gitignore-files flag (default: False)
|
# Test without the --add-gitignore-files flag (default: False)
|
||||||
with patch("sys.stdout", new_callable=StringIO) as mock_stdout:
|
coder = main(
|
||||||
coder = main(
|
["--exit", "--yes", abs_ignored_file],
|
||||||
["--exit", "--yes", abs_ignored_file],
|
input=DummyInput(),
|
||||||
input=DummyInput(),
|
output=DummyOutput(),
|
||||||
output=DummyOutput(),
|
return_coder=True,
|
||||||
return_coder=True,
|
force_git_root=git_dir,
|
||||||
force_git_root=git_dir,
|
)
|
||||||
)
|
# Verify the ignored file is not in the chat
|
||||||
# Verify the ignored file is not in the chat
|
self.assertNotIn(abs_ignored_file, coder.abs_fnames)
|
||||||
self.assertNotIn(abs_ignored_file, coder.abs_fnames)
|
|
||||||
|
|
||||||
# Test with --add-gitignore-files set to True
|
# Test with --add-gitignore-files set to True
|
||||||
coder = main(
|
coder = main(
|
||||||
|
@ -218,20 +217,19 @@ class TestMain(TestCase):
|
||||||
rel_ignored_file = "ignored.txt"
|
rel_ignored_file = "ignored.txt"
|
||||||
|
|
||||||
# Test without the --add-gitignore-files flag (default: False)
|
# Test without the --add-gitignore-files flag (default: False)
|
||||||
with patch("sys.stdout", new_callable=StringIO) as mock_stdout:
|
coder = main(
|
||||||
coder = main(
|
["--exit", "--yes"],
|
||||||
["--exit", "--yes"],
|
input=DummyInput(),
|
||||||
input=DummyInput(),
|
output=DummyOutput(),
|
||||||
output=DummyOutput(),
|
return_coder=True,
|
||||||
return_coder=True,
|
force_git_root=git_dir,
|
||||||
force_git_root=git_dir,
|
)
|
||||||
)
|
|
||||||
|
|
||||||
with patch.object(coder.io, "confirm_ask", return_value=True):
|
with patch.object(coder.io, "confirm_ask", return_value=True):
|
||||||
coder.commands.cmd_add(rel_ignored_file)
|
coder.commands.cmd_add(rel_ignored_file)
|
||||||
|
|
||||||
# Verify the ignored file is not in the chat
|
# Verify the ignored file is not in the chat
|
||||||
self.assertNotIn(abs_ignored_file, coder.abs_fnames)
|
self.assertNotIn(abs_ignored_file, coder.abs_fnames)
|
||||||
|
|
||||||
# Test with --add-gitignore-files set to True
|
# Test with --add-gitignore-files set to True
|
||||||
coder = main(
|
coder = main(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue