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

@ -22,7 +22,13 @@ class TestHelp(unittest.TestCase):
help_coder_run = MagicMock(return_value="")
aider.coders.HelpCoder.run = help_coder_run
commands.cmd_help("hi")
try:
commands.cmd_help("hi")
except aider.commands.SwitchCoder:
pass
else:
# If no exception was raised, fail the test
assert False, "SwitchCoder exception was not raised"
help_coder_run.assert_called_once()