mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
feat: add test for return_coder parameter
This commit is contained in:
parent
c13b277070
commit
7538b3be9e
1 changed files with 19 additions and 0 deletions
|
@ -15,6 +15,7 @@ from aider.dump import dump # noqa: F401
|
||||||
from aider.io import InputOutput
|
from aider.io import InputOutput
|
||||||
from aider.main import check_gitignore, main, setup_git
|
from aider.main import check_gitignore, main, setup_git
|
||||||
from aider.utils import GitTemporaryDirectory, IgnorantTemporaryDirectory, make_repo
|
from aider.utils import GitTemporaryDirectory, IgnorantTemporaryDirectory, make_repo
|
||||||
|
from aider.coders import Coder
|
||||||
|
|
||||||
|
|
||||||
class TestMain(TestCase):
|
class TestMain(TestCase):
|
||||||
|
@ -555,3 +556,21 @@ class TestMain(TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertFalse(coder.add_cache_headers)
|
self.assertFalse(coder.add_cache_headers)
|
||||||
|
|
||||||
|
def test_return_coder(self):
|
||||||
|
with GitTemporaryDirectory():
|
||||||
|
result = main(
|
||||||
|
["--exit", "--yes"],
|
||||||
|
input=DummyInput(),
|
||||||
|
output=DummyOutput(),
|
||||||
|
return_coder=True,
|
||||||
|
)
|
||||||
|
self.assertIsInstance(result, Coder)
|
||||||
|
|
||||||
|
result = main(
|
||||||
|
["--exit", "--yes"],
|
||||||
|
input=DummyInput(),
|
||||||
|
output=DummyOutput(),
|
||||||
|
return_coder=False,
|
||||||
|
)
|
||||||
|
self.assertIsNone(result)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue