(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestHasMCPScripts(t *testing.T) { |
| 11 | tests := []struct { |
| 12 | name string |
| 13 | config *MCPScriptsConfig |
| 14 | expected bool |
| 15 | }{ |
| 16 | { |
| 17 | name: "nil config", |
| 18 | config: nil, |
| 19 | expected: false, |
| 20 | }, |
| 21 | { |
| 22 | name: "empty tools", |
| 23 | config: &MCPScriptsConfig{Tools: map[string]*MCPScriptToolConfig{}}, |
| 24 | expected: false, |
| 25 | }, |
| 26 | { |
| 27 | name: "with tools", |
| 28 | config: &MCPScriptsConfig{ |
| 29 | Tools: map[string]*MCPScriptToolConfig{ |
| 30 | "test": {Name: "test", Description: "Test tool"}, |
| 31 | }, |
| 32 | }, |
| 33 | expected: true, |
| 34 | }, |
| 35 | } |
| 36 | |
| 37 | for _, tt := range tests { |
| 38 | t.Run(tt.name, func(t *testing.T) { |
| 39 | result := HasMCPScripts(tt.config) |
| 40 | if result != tt.expected { |
| 41 | t.Errorf("Expected %v, got %v", tt.expected, result) |
| 42 | } |
| 43 | }) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | func TestIsMCPScriptsEnabled(t *testing.T) { |
| 48 | // Test config with tools |
nothing calls this directly
no test coverage detected