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

Function TestNonExistentCommandLineFile

tools/clientcmd/loader_test.go:81–93  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

79)
80
81func TestNonExistentCommandLineFile(t *testing.T) {
82 loadingRules := ClientConfigLoadingRules{
83 ExplicitPath: "bogus_file",
84 }
85
86 _, err := loadingRules.Load()
87 if err == nil {
88 t.Fatalf("Expected error for missing command-line file, got none")
89 }
90 if !strings.Contains(err.Error(), "bogus_file") {
91 t.Fatalf("Expected error about 'bogus_file', got %s", err.Error())
92 }
93}
94
95func TestToleratingMissingFiles(t *testing.T) {
96 loadingRules := ClientConfigLoadingRules{

Callers

nothing calls this directly

Calls 2

LoadMethod · 0.95
ErrorMethod · 0.65

Tested by

no test coverage detected