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

Function test_basic_commands

diagnostics/cli_command_diagnostic.py:61–89  ·  view source on GitHub ↗

Test basic mcp-cli commands.

()

Source from the content-addressed store, hash-verified

59
60
61def test_basic_commands():
62 """Test basic mcp-cli commands."""
63 print("\n" + "=" * 50)
64 print("🧪 Testing Basic MCP CLI Commands")
65 print("=" * 50)
66
67 tests = [
68 (["--help"], "Help command"),
69 (["tools", "--help"], "Tools help"),
70 (["servers", "--help"], "Servers help"),
71 (["provider", "--help"], "Provider help"),
72 (["models", "--help"], "Models help"),
73 ]
74
75 results = []
76 for args, description in tests:
77 print(f"\n📝 {description}")
78 success, stdout, stderr = test_mcp_cli_command(args, timeout=10)
79
80 if success:
81 print(f"✅ PASS: {description}")
82 else:
83 print(f"❌ FAIL: {description}")
84 if stderr:
85 print(f" Error: {stderr[:200]}...")
86
87 results.append((description, success))
88
89 return results
90
91
92def test_server_commands(config_file="server_config.json"):

Callers 1

mainFunction · 0.85

Calls 1

test_mcp_cli_commandFunction · 0.85

Tested by

no test coverage detected