mirror of https://github.com/docker/cli.git
Add test case to cover non-empty auth entry
Signed-off-by: Jon Johnson <jonjohnson@google.com>
(cherry picked from commit 415f608620
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
a1c4a0f9e8
commit
41b01f1319
|
@ -389,9 +389,16 @@ func TestLoadFromReaderWithUsernamePassword(t *testing.T) {
|
||||||
Username: "user",
|
Username: "user",
|
||||||
Password: "pass",
|
Password: "pass",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, tc := range []types.AuthConfig{
|
||||||
|
want,
|
||||||
|
types.AuthConfig{
|
||||||
|
Auth: encodeAuth(&want),
|
||||||
|
},
|
||||||
|
} {
|
||||||
cf := ConfigFile{
|
cf := ConfigFile{
|
||||||
AuthConfigs: map[string]types.AuthConfig{
|
AuthConfigs: map[string]types.AuthConfig{
|
||||||
"example.com/foo": want,
|
"example.com/foo": tc,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,6 +414,7 @@ func TestLoadFromReaderWithUsernamePassword(t *testing.T) {
|
||||||
assert.Check(t, is.DeepEqual(want.Username, got.Username))
|
assert.Check(t, is.DeepEqual(want.Username, got.Username))
|
||||||
assert.Check(t, is.DeepEqual(want.Password, got.Password))
|
assert.Check(t, is.DeepEqual(want.Password, got.Password))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestCheckKubernetesConfigurationRaiseAnErrorOnInvalidValue(t *testing.T) {
|
func TestCheckKubernetesConfigurationRaiseAnErrorOnInvalidValue(t *testing.T) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
|
|
Loading…
Reference in New Issue