MCPcopy
hub / github.com/kite-org/kite / TestToEnvName

Function TestToEnvName

pkg/utils/utils_test.go:126–145  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

124}
125
126func TestToEnvName(t *testing.T) {
127 testCases := []struct {
128 name string
129 in string
130 want string
131 }{
132 {name: "hyphen and dot", in: "a-b.c", want: "A_B_C"},
133 {name: "slash", in: "kube/system", want: "KUBE_SYSTEM"},
134 {name: "mixed case", in: "KiteBase", want: "KITEBASE"},
135 }
136
137 for _, tc := range testCases {
138 t.Run(tc.name, func(t *testing.T) {
139 got := ToEnvName(tc.in)
140 if got != tc.want {
141 t.Fatalf("ToEnvName(%q) = %q, want %q", tc.in, got, tc.want)
142 }
143 })
144 }
145}
146
147func TestGenerateKubectlAgentName(t *testing.T) {
148 testCases := []struct {

Callers

nothing calls this directly

Calls 2

ToEnvNameFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected