MCPcopy Create free account
hub / github.com/github/gh-aw / TestHasMCPScripts

Function TestHasMCPScripts

pkg/workflow/mcp_scripts_parser_test.go:10–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func 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
47func TestIsMCPScriptsEnabled(t *testing.T) {
48 // Test config with tools

Callers

nothing calls this directly

Calls 3

HasMCPScriptsFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected