feat: Add test for --sonnet --cache-prompts --exit options

This commit is contained in:
Paul Gauthier (aider) 2024-08-19 16:05:02 -07:00
parent f9471fc5b6
commit 75a7a0043a

View file

@ -533,3 +533,21 @@ class TestMain(TestCase):
self.assertEqual(
call_kwargs.get("refresh"), "files"
) # Check the 'refresh' keyword argument
def test_sonnet_and_cache_prompts_options(self):
with GitTemporaryDirectory():
with patch("aider.coders.Coder.create") as MockCoder:
mock_coder = MagicMock()
MockCoder.return_value = mock_coder
main(
["--sonnet", "--cache-prompts", "--exit", "--yes"],
input=DummyInput(),
output=DummyOutput(),
)
MockCoder.assert_called_once()
_, kwargs = MockCoder.call_args
self.assertEqual(kwargs["main_model"].name, "gpt-4-1106-preview")
self.assertTrue(kwargs["cache_prompts"])
self.assertTrue(mock_coder.add_cache_headers)