mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-20 19:45:00 +00:00
isort
This commit is contained in:
parent
95be55a2b6
commit
92cd2f3ce6
15 changed files with 56 additions and 38 deletions
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
import unittest
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from aider.coder import Coder
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
from unittest import TestCase
|
||||
|
||||
from aider.commands import Commands
|
||||
from aider.io import InputOutput
|
||||
|
||||
import shutil
|
||||
|
||||
class TestCommands(TestCase):
|
||||
def setUp(self):
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
import os
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from aider.io import InputOutput
|
||||
|
||||
|
||||
class TestInputOutput(unittest.TestCase):
|
||||
def test_no_color_environment_variable(self):
|
||||
with patch.dict(os.environ, {"NO_COLOR": "1"}):
|
||||
io = InputOutput()
|
||||
self.assertFalse(io.pretty)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
import os
|
||||
import tempfile
|
||||
import subprocess
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
from io import StringIO
|
||||
from unittest import TestCase
|
||||
from unittest.mock import patch
|
||||
from aider.main import main
|
||||
|
||||
from prompt_toolkit.input import create_input
|
||||
from io import StringIO
|
||||
from prompt_toolkit.output import DummyOutput
|
||||
|
||||
from aider.main import main
|
||||
|
||||
|
||||
class TestMain(TestCase):
|
||||
def setUp(self):
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import os
|
||||
import tempfile
|
||||
import unittest
|
||||
from aider.repomap import RepoMap
|
||||
from unittest.mock import patch
|
||||
from subprocess import CompletedProcess
|
||||
from unittest.mock import patch
|
||||
|
||||
from aider.repomap import RepoMap
|
||||
|
||||
|
||||
class TestRepoMap(unittest.TestCase):
|
||||
def test_get_tags_map(self):
|
||||
|
@ -65,7 +67,14 @@ def my_function(arg1, arg2):
|
|||
|
||||
def test_check_for_ctags_success(self):
|
||||
with patch("subprocess.run") as mock_run:
|
||||
mock_run.return_value = CompletedProcess(args=["ctags", "--version"], returncode=0, stdout=b'{"_type": "tag", "name": "status", "path": "aider/main.py", "pattern": "/^ status = main()$/", "kind": "variable"}')
|
||||
mock_run.return_value = CompletedProcess(
|
||||
args=["ctags", "--version"],
|
||||
returncode=0,
|
||||
stdout=(
|
||||
b'{"_type": "tag", "name": "status", "path": "aider/main.py", "pattern": "/^ '
|
||||
b' status = main()$/", "kind": "variable"}'
|
||||
),
|
||||
)
|
||||
repo_map = RepoMap(use_ctags=True)
|
||||
result = repo_map.check_for_ctags()
|
||||
self.assertTrue(result)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# flake8: noqa: E501
|
||||
|
||||
import unittest
|
||||
|
||||
from aider import utils
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue