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

Function TestBuildSafeOutputOptions

pkg/cli/interactive_test.go:579–604  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

577}
578
579func TestBuildSafeOutputOptions(t *testing.T) {
580 options := buildSafeOutputOptions()
581
582 // Should have options loaded from safe_outputs_tools.json
583 if len(options) == 0 {
584 t.Fatal("buildSafeOutputOptions returned no options")
585 }
586
587 // Should not include internal tools
588 for _, opt := range options {
589 if opt.Value == "missing-tool" || opt.Value == "noop" || opt.Value == "missing-data" {
590 t.Errorf("buildSafeOutputOptions should not include internal tool %q", opt.Value)
591 }
592 }
593
594 // Should include common user-facing tools
595 values := make(map[string]bool)
596 for _, opt := range options {
597 values[opt.Value] = true
598 }
599 for _, expected := range []string{"create-issue", "add-comment", "create-pull-request"} {
600 if !values[expected] {
601 t.Errorf("buildSafeOutputOptions should include %q", expected)
602 }
603 }
604}
605
606func TestDetectNetworkFromRepo(t *testing.T) {
607 // detectNetworkFromRepo inspects the current directory; we exercise it

Callers

nothing calls this directly

Calls 2

buildSafeOutputOptionsFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected