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

Function TestClaudeEnginePermissionMode

pkg/workflow/claude_engine_test.go:229–349  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

227}
228
229func TestClaudeEnginePermissionMode(t *testing.T) {
230 engine := NewClaudeEngine()
231
232 tests := []struct {
233 name string
234 tools map[string]any
235 engineConfig *EngineConfig
236 expectedMode string
237 notExpectedMode string
238 }{
239 {
240 name: "no tools — default acceptEdits",
241 tools: nil,
242 expectedMode: "acceptEdits",
243 notExpectedMode: "bypassPermissions",
244 },
245 {
246 name: "restricted bash — acceptEdits",
247 tools: map[string]any{
248 "bash": []any{"git", "echo"},
249 },
250 expectedMode: "acceptEdits",
251 notExpectedMode: "bypassPermissions",
252 },
253 {
254 name: "bash wildcard * no longer forces bypassPermissions",
255 tools: map[string]any{
256 "bash": []any{"*"},
257 },
258 expectedMode: "acceptEdits",
259 notExpectedMode: "bypassPermissions",
260 },
261 {
262 name: "bash colon-wildcard :* no longer forces bypassPermissions",
263 tools: map[string]any{
264 "bash": []any{":*"},
265 },
266 expectedMode: "acceptEdits",
267 notExpectedMode: "bypassPermissions",
268 },
269 {
270 name: "bash true no longer forces bypassPermissions",
271 tools: map[string]any{
272 "bash": true,
273 },
274 expectedMode: "acceptEdits",
275 notExpectedMode: "bypassPermissions",
276 },
277 {
278 name: "bash nil no longer forces bypassPermissions",
279 tools: map[string]any{
280 "bash": nil,
281 },
282 expectedMode: "acceptEdits",
283 notExpectedMode: "bypassPermissions",
284 },
285 {
286 name: "edit false defaults to auto permission mode",

Callers

nothing calls this directly

Calls 4

GetExecutionStepsMethod · 0.95
NewClaudeEngineFunction · 0.85
RunMethod · 0.45
CountMethod · 0.45

Tested by

no test coverage detected