feat: Add tests for --map-tokens option

This commit is contained in:
Paul Gauthier (aider) 2024-08-06 09:04:01 -03:00
parent 04fff71e73
commit 45f6f88a46

View file

@ -374,3 +374,15 @@ class TestMain(TestCase):
self.assertIn("dark_mode", relevant_output)
self.assertRegex(relevant_output, r"AIDER_DARK_MODE:\s+on")
self.assertRegex(relevant_output, r"dark_mode:\s+True")
def test_map_tokens_option(self):
with GitTemporaryDirectory():
with patch("aider.repomap.RepoMap") as MockRepoMap:
main(["--model", "gpt-4", "--map-tokens", "0", "--exit"], input=DummyInput(), output=DummyOutput())
MockRepoMap.assert_not_called()
def test_map_tokens_option_with_non_zero_value(self):
with GitTemporaryDirectory():
with patch("aider.repomap.RepoMap") as MockRepoMap:
main(["--model", "gpt-4", "--map-tokens", "1000", "--exit"], input=DummyInput(), output=DummyOutput())
MockRepoMap.assert_called_once()