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

Method test_group_execute_no_subcommand

tests/commands/test_base.py:263–278  ·  view source on GitHub ↗

Test executing a group without specifying a subcommand.

(self)

Source from the content-addressed store, hash-verified

261
262 @pytest.mark.asyncio
263 async def test_group_execute_no_subcommand(self):
264 """Test executing a group without specifying a subcommand."""
265 group = DummyCommandGroup()
266
267 cmd1 = DummyCommand(name="sub1", description="Subcommand 1")
268 cmd2 = DummyCommand(name="sub2", description="Subcommand 2")
269
270 group.add_subcommand(cmd1)
271 group.add_subcommand(cmd2)
272
273 result = await group.execute()
274
275 assert result.success is True
276 assert "Available test_group commands" in result.output
277 assert "sub1: Subcommand 1" in result.output
278 assert "sub2: Subcommand 2" in result.output
279
280 @pytest.mark.asyncio
281 async def test_group_execute_with_subcommand(self):

Callers

nothing calls this directly

Calls 4

add_subcommandMethod · 0.80
DummyCommandGroupClass · 0.70
DummyCommandClass · 0.70
executeMethod · 0.45

Tested by

no test coverage detected