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

Function TestValidateEmptyContext

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

Source from the content-addressed store, hash-verified

180}
181
182func TestValidateEmptyContext(t *testing.T) {
183 config := clientcmdapi.NewConfig()
184 config.CurrentContext = "anything"
185 config.Contexts["anything"] = &clientcmdapi.Context{}
186 test := configValidationTest{
187 config: config,
188 expectedErrorSubstring: []string{"user was not specified for context \"anything\"", "cluster was not specified for context \"anything\""},
189 }
190
191 test.testContext("anything", t)
192 test.testConfig(t)
193}
194
195func TestValidateEmptyContextName(t *testing.T) {
196 config := clientcmdapi.NewConfig()

Callers

nothing calls this directly

Calls 2

testContextMethod · 0.95
testConfigMethod · 0.95

Tested by

no test coverage detected