MCPcopy Create free account
hub / github.com/IBM/mcp-cli / test_group_model_command_shortcut

Method test_group_model_command_shortcut

tests/commands/test_base.py:328–348  ·  view source on GitHub ↗

Test model command treats unknown subcommand as model name.

(self)

Source from the content-addressed store, hash-verified

326
327 @pytest.mark.asyncio
328 async def test_group_model_command_shortcut(self):
329 """Test model command treats unknown subcommand as model name."""
330
331 class ModelGroup(CommandGroup):
332 @property
333 def name(self) -> str:
334 return "model"
335
336 @property
337 def description(self) -> str:
338 return "Test model group"
339
340 group = ModelGroup()
341 set_cmd = DummyCommand(name="set", description="Set model")
342 group.add_subcommand(set_cmd)
343
344 # Pass a model name as if it's a subcommand
345 result = await group.execute(subcommand="gpt-4")
346
347 assert result.success is True
348 # The model_name should be passed to kwargs
349
350 @pytest.mark.asyncio
351 async def test_group_provider_command_shortcut(self):

Callers

nothing calls this directly

Calls 4

ModelGroupClass · 0.85
add_subcommandMethod · 0.80
DummyCommandClass · 0.70
executeMethod · 0.45

Tested by

no test coverage detected