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

Function TestNamespaceOverride

tools/clientcmd/client_config_test.go:649–669  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

647}
648
649func TestNamespaceOverride(t *testing.T) {
650 config := &DirectClientConfig{
651 overrides: &ConfigOverrides{
652 Context: clientcmdapi.Context{
653 Namespace: "foo",
654 },
655 },
656 }
657
658 ns, overridden, err := config.Namespace()
659
660 if err != nil {
661 t.Errorf("Unexpected error: %v", err)
662 }
663
664 if !overridden {
665 t.Errorf("Expected overridden = true")
666 }
667
668 matchStringArg("foo", ns, t)
669}
670
671func TestAuthConfigMerge(t *testing.T) {
672 content := `

Callers

nothing calls this directly

Calls 3

NamespaceMethod · 0.95
matchStringArgFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected