From 697a8b66ea9077752577956dbf1263a786cfc456 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 19 Aug 2024 15:35:20 -0700 Subject: [PATCH] fix: Update test_sonnet_and_cache_options to match actual RepoMap call --- tests/basic/test_main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/basic/test_main.py b/tests/basic/test_main.py index 6fd91ec8b..dd2eb55bb 100644 --- a/tests/basic/test_main.py +++ b/tests/basic/test_main.py @@ -516,7 +516,7 @@ class TestMain(TestCase): self.assertEqual(coder.main_model.info["max_input_tokens"], 1234) def test_sonnet_and_cache_options(self): - with GitTemporaryDirectory(): + with GitTemporaryDirectory() as temp_dir: with patch("aider.coders.base_coder.RepoMap") as MockRepoMap: mock_repo_map = MagicMock() mock_repo_map.max_map_tokens = 1000 # Set a specific value @@ -528,4 +528,8 @@ class TestMain(TestCase): output=DummyOutput(), ) - MockRepoMap.assert_called_once_with(refresh="files") + MockRepoMap.assert_called_once() + call_args, call_kwargs = MockRepoMap.call_args + self.assertEqual(call_args[0], 1024) # Check the first positional argument + self.assertEqual(call_args[1], temp_dir) # Check the second positional argument + self.assertEqual(call_kwargs.get('refresh'), 'files') # Check the 'refresh' keyword argument