feat(cli): allow custom OpenRouter model IDs

This commit is contained in:
CadeYu 2026-03-21 13:38:42 +08:00
parent 4bcca59ee8
commit 2d41e39f89
1 changed files with 25 additions and 0 deletions

View File

@ -19,6 +19,31 @@ class OpenRouterModelSelectionTests(unittest.TestCase):
)
self.assertEqual(chosen, "minimax/minimax-m2.1")
def test_exit_on_no_choice(self):
with self.assertRaises(SystemExit) as cm:
resolve_model_choice("openrouter", None, "Quick-Thinking")
self.assertEqual(cm.exception.code, 1)
def test_exit_on_empty_custom_model_input(self):
with self.assertRaises(SystemExit) as cm:
resolve_model_choice(
"openrouter",
CUSTOM_OPENROUTER_MODEL,
"Deep-Thinking",
prompt_fn=lambda _: " ",
)
self.assertEqual(cm.exception.code, 1)
def test_exit_on_none_custom_model_input(self):
with self.assertRaises(SystemExit) as cm:
resolve_model_choice(
"openrouter",
CUSTOM_OPENROUTER_MODEL,
"Deep-Thinking",
prompt_fn=lambda _: None,
)
self.assertEqual(cm.exception.code, 1)
if __name__ == "__main__":
unittest.main()