MCPcopy
hub / github.com/google/go-containerregistry / TestConfigFileIsADir

Function TestConfigFileIsADir

pkg/authn/keychain_test.go:397–413  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

395}
396
397func 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
415type fakeKeychain struct {
416 auth Authenticator

Callers

nothing calls this directly

Calls 2

setupConfigDirFunction · 0.85
ResolveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…