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

Function TestGitHubToolConfigLockdownParsing

pkg/workflow/github_lockdown_test.go:66–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestGitHubToolConfigLockdownParsing(t *testing.T) {
67 tests := []struct {
68 name string
69 config map[string]any
70 expected bool
71 }{
72 {
73 name: "lockdown true in config",
74 config: map[string]any{
75 "lockdown": true,
76 "mode": "local",
77 },
78 expected: true,
79 },
80 {
81 name: "lockdown false in config",
82 config: map[string]any{
83 "lockdown": false,
84 "mode": "remote",
85 },
86 expected: false,
87 },
88 {
89 name: "lockdown not present",
90 config: map[string]any{
91 "mode": "local",
92 },
93 expected: false,
94 },
95 }
96
97 for _, tt := range tests {
98 t.Run(tt.name, func(t *testing.T) {
99 parsed := parseGitHubTool(tt.config)
100 if parsed.Lockdown != tt.expected {
101 t.Errorf("parseGitHubTool().Lockdown = %v, want %v", parsed.Lockdown, tt.expected)
102 }
103 })
104 }
105}
106
107func TestRenderGitHubMCPDockerConfigWithLockdown(t *testing.T) {
108 tests := []struct {

Callers

nothing calls this directly

Calls 3

parseGitHubToolFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected