mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 21:04:59 +00:00
fixed tests
This commit is contained in:
parent
efd3c39e50
commit
a2f6860e34
7 changed files with 13 additions and 13 deletions
|
@ -15,7 +15,7 @@ from aider.utils import ChdirTemporaryDirectory, GitTemporaryDirectory
|
||||||
|
|
||||||
class TestCoder(unittest.TestCase):
|
class TestCoder(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.GPT35 = Model("gpt-3.5-turbo", validate_environment=False)
|
self.GPT35 = Model("gpt-3.5-turbo")
|
||||||
|
|
||||||
def test_allowed_to_edit(self):
|
def test_allowed_to_edit(self):
|
||||||
with GitTemporaryDirectory():
|
with GitTemporaryDirectory():
|
||||||
|
|
|
@ -23,7 +23,7 @@ class TestCommands(TestCase):
|
||||||
self.tempdir = tempfile.mkdtemp()
|
self.tempdir = tempfile.mkdtemp()
|
||||||
os.chdir(self.tempdir)
|
os.chdir(self.tempdir)
|
||||||
|
|
||||||
self.GPT35 = Model("gpt-3.5-turbo", validate_environment=False)
|
self.GPT35 = Model("gpt-3.5-turbo")
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
os.chdir(self.original_cwd)
|
os.chdir(self.original_cwd)
|
||||||
|
|
|
@ -14,7 +14,7 @@ from aider.models import Model
|
||||||
|
|
||||||
class TestUtils(unittest.TestCase):
|
class TestUtils(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.GPT35 = Model("gpt-3.5-turbo", validate_environment=False)
|
self.GPT35 = Model("gpt-3.5-turbo")
|
||||||
|
|
||||||
# fuzzy logic disabled v0.11.2-dev
|
# fuzzy logic disabled v0.11.2-dev
|
||||||
def __test_replace_most_similar_chunk(self):
|
def __test_replace_most_similar_chunk(self):
|
||||||
|
|
|
@ -5,22 +5,22 @@ from aider.models import Model
|
||||||
|
|
||||||
class TestModels(unittest.TestCase):
|
class TestModels(unittest.TestCase):
|
||||||
def test_max_context_tokens(self):
|
def test_max_context_tokens(self):
|
||||||
model = Model("gpt-3.5-turbo", validate_environment=False)
|
model = Model("gpt-3.5-turbo")
|
||||||
self.assertEqual(model.info["max_input_tokens"], 16385)
|
self.assertEqual(model.info["max_input_tokens"], 16385)
|
||||||
|
|
||||||
model = Model("gpt-3.5-turbo-16k", validate_environment=False)
|
model = Model("gpt-3.5-turbo-16k")
|
||||||
self.assertEqual(model.info["max_input_tokens"], 16385)
|
self.assertEqual(model.info["max_input_tokens"], 16385)
|
||||||
|
|
||||||
model = Model("gpt-3.5-turbo-1106", validate_environment=False)
|
model = Model("gpt-3.5-turbo-1106")
|
||||||
self.assertEqual(model.info["max_input_tokens"], 16385)
|
self.assertEqual(model.info["max_input_tokens"], 16385)
|
||||||
|
|
||||||
model = Model("gpt-4", validate_environment=False)
|
model = Model("gpt-4")
|
||||||
self.assertEqual(model.info["max_input_tokens"], 8 * 1024)
|
self.assertEqual(model.info["max_input_tokens"], 8 * 1024)
|
||||||
|
|
||||||
model = Model("gpt-4-32k", validate_environment=False)
|
model = Model("gpt-4-32k")
|
||||||
self.assertEqual(model.info["max_input_tokens"], 32 * 1024)
|
self.assertEqual(model.info["max_input_tokens"], 32 * 1024)
|
||||||
|
|
||||||
model = Model("gpt-4-0613", validate_environment=False)
|
model = Model("gpt-4-0613")
|
||||||
self.assertEqual(model.info["max_input_tokens"], 8 * 1024)
|
self.assertEqual(model.info["max_input_tokens"], 8 * 1024)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ from aider.utils import GitTemporaryDirectory
|
||||||
|
|
||||||
class TestRepo(unittest.TestCase):
|
class TestRepo(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.GPT35 = Model("gpt-3.5-turbo", validate_environment=False)
|
self.GPT35 = Model("gpt-3.5-turbo")
|
||||||
|
|
||||||
def test_diffs_empty_repo(self):
|
def test_diffs_empty_repo(self):
|
||||||
with GitTemporaryDirectory():
|
with GitTemporaryDirectory():
|
||||||
|
|
|
@ -10,7 +10,7 @@ from aider.utils import IgnorantTemporaryDirectory
|
||||||
|
|
||||||
class TestRepoMap(unittest.TestCase):
|
class TestRepoMap(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.GPT35 = Model("gpt-3.5-turbo", validate_environment=False)
|
self.GPT35 = Model("gpt-3.5-turbo")
|
||||||
|
|
||||||
def test_get_repo_map(self):
|
def test_get_repo_map(self):
|
||||||
# Create a temporary directory with sample files for testing
|
# Create a temporary directory with sample files for testing
|
||||||
|
@ -156,7 +156,7 @@ print(my_function(3, 4))
|
||||||
|
|
||||||
class TestRepoMapTypescript(unittest.TestCase):
|
class TestRepoMapTypescript(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.GPT35 = Model("gpt-3.5-turbo", validate_environment=False)
|
self.GPT35 = Model("gpt-3.5-turbo")
|
||||||
|
|
||||||
def test_get_repo_map_typescript(self):
|
def test_get_repo_map_typescript(self):
|
||||||
# Create a temporary directory with a sample TypeScript file
|
# Create a temporary directory with a sample TypeScript file
|
||||||
|
|
|
@ -18,7 +18,7 @@ class TestWholeFileCoder(unittest.TestCase):
|
||||||
self.tempdir = tempfile.mkdtemp()
|
self.tempdir = tempfile.mkdtemp()
|
||||||
os.chdir(self.tempdir)
|
os.chdir(self.tempdir)
|
||||||
|
|
||||||
self.GPT35 = Model("gpt-3.5-turbo", validate_environment=False)
|
self.GPT35 = Model("gpt-3.5-turbo")
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
os.chdir(self.original_cwd)
|
os.chdir(self.original_cwd)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue