(t *testing.T)
| 395 | } |
| 396 | |
| 397 | func TestConfigFileIsADir(t *testing.T) { |
| 398 | tmpdir := setupConfigDir(t) |
| 399 | // Create "config.json" as a directory, not a file to simulate optional |
| 400 | // secrets in Kubernetes. |
| 401 | err := os.Mkdir(path.Join(tmpdir, "config.json"), 0777) |
| 402 | if err != nil { |
| 403 | t.Fatal(err) |
| 404 | } |
| 405 | |
| 406 | auth, err := DefaultKeychain.Resolve(testRegistry) |
| 407 | if err != nil { |
| 408 | t.Fatalf("Resolve() = %v", err) |
| 409 | } |
| 410 | if auth != Anonymous { |
| 411 | t.Errorf("expected Anonymous, got %v", auth) |
| 412 | } |
| 413 | } |
| 414 | |
| 415 | type fakeKeychain struct { |
| 416 | auth Authenticator |
nothing calls this directly
no test coverage detected
searching dependent graphs…