MCPcopy
hub / github.com/Aider-AI/aider / test_cmd_model

Method test_cmd_model

tests/basic/test_commands.py:1717–1736  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1715 self.assertIn("+Final modified content", diff_output)
1716
1717 def test_cmd_model(self):
1718 io = InputOutput(pretty=False, fancy_input=False, yes=True)
1719 coder = Coder.create(self.GPT35, None, io)
1720 commands = Commands(io, coder)
1721
1722 # Test switching the main model
1723 with self.assertRaises(SwitchCoder) as context:
1724 commands.cmd_model("gpt-4")
1725
1726 # Check that the SwitchCoder exception contains the correct model configuration
1727 self.assertEqual(context.exception.kwargs.get("main_model").name, "gpt-4")
1728 self.assertEqual(
1729 context.exception.kwargs.get("main_model").editor_model.name,
1730 self.GPT35.editor_model.name,
1731 )
1732 self.assertEqual(
1733 context.exception.kwargs.get("main_model").weak_model.name, self.GPT35.weak_model.name
1734 )
1735 # Check that the edit format is updated to the new model's default
1736 self.assertEqual(context.exception.kwargs.get("edit_format"), "diff")
1737
1738 def test_cmd_model_preserves_explicit_edit_format(self):
1739 io = InputOutput(pretty=False, fancy_input=False, yes=True)

Callers

nothing calls this directly

Calls 4

cmd_modelMethod · 0.95
InputOutputClass · 0.90
CommandsClass · 0.90
createMethod · 0.80

Tested by

no test coverage detected