MCPcopy
hub / github.com/kubernetes/client-go / TestValidateEmptyContextName

Function TestValidateEmptyContextName

tools/clientcmd/validation_test.go:195–206  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

193}
194
195func TestValidateEmptyContextName(t *testing.T) {
196 config := clientcmdapi.NewConfig()
197 config.CurrentContext = "anything"
198 config.Contexts[""] = &clientcmdapi.Context{Cluster: "missing", AuthInfo: "missing"}
199 test := configValidationTest{
200 config: config,
201 expectedErrorSubstring: []string{"empty context name", "is not allowed"},
202 }
203
204 test.testContext("", t)
205 test.testConfig(t)
206}
207
208func TestValidateEmptyClusterInfo(t *testing.T) {
209 config := clientcmdapi.NewConfig()

Callers

nothing calls this directly

Calls 2

testContextMethod · 0.95
testConfigMethod · 0.95

Tested by

no test coverage detected