fix: Add SwitchCoder exception handling in cmd_help

This commit is contained in:
Paul Gauthier 2024-08-10 14:49:55 -07:00 committed by Paul Gauthier (aider)
parent e7c035def4
commit 216ad3b6b5
2 changed files with 8 additions and 8 deletions

View file

@ -10,7 +10,7 @@ from unittest import TestCase, mock
import git
from aider.coders import Coder
from aider.commands import Commands
from aider.commands import Commands, SwitchCoder
from aider.dump import dump # noqa: F401
from aider.io import InputOutput
from aider.models import Model
@ -882,12 +882,6 @@ class TestCommands(TestCase):
mock_run.assert_called_once()
mock_run.assert_called_once_with(question)
self.assertEqual(len(coder.cur_messages), 2)
self.assertEqual(coder.cur_messages[0]["role"], "user")
self.assertEqual(coder.cur_messages[0]["content"], question)
self.assertEqual(coder.cur_messages[1]["role"], "assistant")
self.assertEqual(coder.cur_messages[1]["content"], canned_reply)
def test_cmd_lint_with_dirty_file(self):
with GitTemporaryDirectory() as repo_dir:
repo = git.Repo(repo_dir)