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

Function TestGenerateNetworkConfig_MultiNetwork

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

Source from the content-addressed store, hash-verified

690}
691
692func TestGenerateNetworkConfig_MultiNetwork(t *testing.T) {
693 tests := []struct {
694 name string
695 network string
696 expected string
697 }{
698 {
699 name: "single defaults",
700 network: "defaults",
701 expected: "network: defaults\n",
702 },
703 {
704 name: "ecosystem expands all",
705 network: "ecosystem",
706 expected: "network:\n allowed:\n - defaults\n - python\n - node\n - go\n - java\n",
707 },
708 {
709 name: "auto-detected comma-separated",
710 network: "defaults,go,node",
711 expected: "network:\n allowed:\n - defaults\n - go\n - node\n",
712 },
713 }
714
715 for _, tt := range tests {
716 t.Run(tt.name, func(t *testing.T) {
717 b := &InteractiveWorkflowBuilder{NetworkAccess: tt.network}
718 got := b.generateNetworkConfig()
719 if got != tt.expected {
720 t.Errorf("generateNetworkConfig() = %q, want %q", got, tt.expected)
721 }
722 })
723 }
724}
725
726func TestGenerateToolsConfig_UsesToolsets(t *testing.T) {
727 b := &InteractiveWorkflowBuilder{Tools: []string{"github", "bash"}}

Callers

nothing calls this directly

Calls 3

generateNetworkConfigMethod · 0.95
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected