From 92cf2cbd474b6fed02da17025a09529ea6a89098 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 19 Nov 2024 12:06:15 -0800 Subject: [PATCH] test: Implement TODOs in test_aider_extra_model_settings --- tests/basic/test_models.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/basic/test_models.py b/tests/basic/test_models.py index 9603cd746..c08784eb8 100644 --- a/tests/basic/test_models.py +++ b/tests/basic/test_models.py @@ -117,11 +117,20 @@ class TestModels(unittest.TestCase): # Test that defaults are applied when no exact match model = Model("claude-3-5-sonnet-20240620") - # TODO: make sure Foo:bar and existing anthropic-beta headers are both here; check some_param; check max_tokens=8192 still there + # Test that both the override and existing headers are present + model = Model("claude-3-5-sonnet-20240620") + self.assertEqual(model.extra_params["extra_headers"]["Foo"], "bar") + self.assertEqual( + model.extra_params["extra_headers"]["anthropic-beta"], + ANTHROPIC_BETA_HEADER, + ) + self.assertEqual(model.extra_params["some_param"], "some value") + self.assertEqual(model.extra_params["max_tokens"], 8192) # Test that exact match overrides defaults but not overrides model = Model("gpt-4") - # TODO: make sure Foo:bar header is there; check some_param + self.assertEqual(model.extra_params["extra_headers"]["Foo"], "bar") + self.assertEqual(model.extra_params["some_param"], "some value")