This commit is contained in:
Paul Gauthier 2023-05-28 22:47:38 -07:00
parent 95be55a2b6
commit 92cd2f3ce6
15 changed files with 56 additions and 38 deletions

View file

@ -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)