mirror of https://github.com/docker/cli.git
Merge pull request #1712 from thaJeztah/fix_test_for_go_1.12
Fix test for Go 1.12.x
This commit is contained in:
commit
c3fc547cc9
|
@ -151,9 +151,8 @@ func TestOldValidAuth(t *testing.T) {
|
||||||
|
|
||||||
// defaultIndexserver is https://index.docker.io/v1/
|
// defaultIndexserver is https://index.docker.io/v1/
|
||||||
ac := config.AuthConfigs["https://index.docker.io/v1/"]
|
ac := config.AuthConfigs["https://index.docker.io/v1/"]
|
||||||
if ac.Username != "joejoe" || ac.Password != "hello" {
|
assert.Equal(t, ac.Username, "joejoe")
|
||||||
t.Fatalf("Missing data from parsing:\n%q", config)
|
assert.Equal(t, ac.Password, "hello")
|
||||||
}
|
|
||||||
|
|
||||||
// Now save it and make sure it shows up in new form
|
// Now save it and make sure it shows up in new form
|
||||||
configStr := saveConfigAndValidateNewFormat(t, config, tmpHome)
|
configStr := saveConfigAndValidateNewFormat(t, config, tmpHome)
|
||||||
|
@ -214,9 +213,8 @@ func TestOldJSON(t *testing.T) {
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
ac := config.AuthConfigs["https://index.docker.io/v1/"]
|
ac := config.AuthConfigs["https://index.docker.io/v1/"]
|
||||||
if ac.Username != "joejoe" || ac.Password != "hello" {
|
assert.Equal(t, ac.Username, "joejoe")
|
||||||
t.Fatalf("Missing data from parsing:\n%q", config)
|
assert.Equal(t, ac.Password, "hello")
|
||||||
}
|
|
||||||
|
|
||||||
// Now save it and make sure it shows up in new form
|
// Now save it and make sure it shows up in new form
|
||||||
configStr := saveConfigAndValidateNewFormat(t, config, tmpHome)
|
configStr := saveConfigAndValidateNewFormat(t, config, tmpHome)
|
||||||
|
@ -250,9 +248,8 @@ func TestNewJSON(t *testing.T) {
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
ac := config.AuthConfigs["https://index.docker.io/v1/"]
|
ac := config.AuthConfigs["https://index.docker.io/v1/"]
|
||||||
if ac.Username != "joejoe" || ac.Password != "hello" {
|
assert.Equal(t, ac.Username, "joejoe")
|
||||||
t.Fatalf("Missing data from parsing:\n%q", config)
|
assert.Equal(t, ac.Password, "hello")
|
||||||
}
|
|
||||||
|
|
||||||
// Now save it and make sure it shows up in new form
|
// Now save it and make sure it shows up in new form
|
||||||
configStr := saveConfigAndValidateNewFormat(t, config, tmpHome)
|
configStr := saveConfigAndValidateNewFormat(t, config, tmpHome)
|
||||||
|
@ -285,9 +282,8 @@ func TestNewJSONNoEmail(t *testing.T) {
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
ac := config.AuthConfigs["https://index.docker.io/v1/"]
|
ac := config.AuthConfigs["https://index.docker.io/v1/"]
|
||||||
if ac.Username != "joejoe" || ac.Password != "hello" {
|
assert.Equal(t, ac.Username, "joejoe")
|
||||||
t.Fatalf("Missing data from parsing:\n%q", config)
|
assert.Equal(t, ac.Password, "hello")
|
||||||
}
|
|
||||||
|
|
||||||
// Now save it and make sure it shows up in new form
|
// Now save it and make sure it shows up in new form
|
||||||
configStr := saveConfigAndValidateNewFormat(t, config, tmpHome)
|
configStr := saveConfigAndValidateNewFormat(t, config, tmpHome)
|
||||||
|
@ -432,10 +428,8 @@ func TestJSONReaderNoFile(t *testing.T) {
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
ac := config.AuthConfigs["https://index.docker.io/v1/"]
|
ac := config.AuthConfigs["https://index.docker.io/v1/"]
|
||||||
if ac.Username != "joejoe" || ac.Password != "hello" {
|
assert.Equal(t, ac.Username, "joejoe")
|
||||||
t.Fatalf("Missing data from parsing:\n%q", config)
|
assert.Equal(t, ac.Password, "hello")
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestOldJSONReaderNoFile(t *testing.T) {
|
func TestOldJSONReaderNoFile(t *testing.T) {
|
||||||
|
@ -445,9 +439,8 @@ func TestOldJSONReaderNoFile(t *testing.T) {
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
ac := config.AuthConfigs["https://index.docker.io/v1/"]
|
ac := config.AuthConfigs["https://index.docker.io/v1/"]
|
||||||
if ac.Username != "joejoe" || ac.Password != "hello" {
|
assert.Equal(t, ac.Username, "joejoe")
|
||||||
t.Fatalf("Missing data from parsing:\n%q", config)
|
assert.Equal(t, ac.Password, "hello")
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestJSONWithPsFormatNoFile(t *testing.T) {
|
func TestJSONWithPsFormatNoFile(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue