Skip to content

Commit

Permalink
Cover a couple special paths in keychain unit tests. (#1302)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmoor committed Feb 23, 2022
1 parent 0527e42 commit dd8d514
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pkg/authn/keychain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,30 @@ func TestVariousPaths(t *testing.T) {
Username: "foo",
Password: "bar",
},
}, {
desc: "valid config file; matches registry w/ v1",
target: testRegistry,
content: fmt.Sprintf(`{
"auths": {
"http://test.io/v1/": {"auth": %q}
}
}`, encode("baz", "quux")),
cfg: &AuthConfig{
Username: "baz",
Password: "quux",
},
}, {
desc: "valid config file; matches registry w/ v2",
target: testRegistry,
content: fmt.Sprintf(`{
"auths": {
"http://test.io/v2/": {"auth": %q}
}
}`, encode("baz", "quux")),
cfg: &AuthConfig{
Username: "baz",
Password: "quux",
},
}, {
desc: "valid config file; matches repo",
target: testRepo,
Expand Down

0 comments on commit dd8d514

Please sign in to comment.