Skip to content

Commit

Permalink
Merge pull request #1712 from thaJeztah/fix_test_for_go_1.12
Browse files Browse the repository at this point in the history
Fix test for Go 1.12.x
  • Loading branch information
tiborvass authored Mar 13, 2019
2 parents c748c85 + d4877fb commit c3fc547
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions cli/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,8 @@ func TestOldValidAuth(t *testing.T) {

// defaultIndexserver is https://index.docker.io/v1/
ac := config.AuthConfigs["https://index.docker.io/v1/"]
if ac.Username != "joejoe" || ac.Password != "hello" {
t.Fatalf("Missing data from parsing:\n%q", config)
}
assert.Equal(t, ac.Username, "joejoe")
assert.Equal(t, ac.Password, "hello")

// Now save it and make sure it shows up in new form
configStr := saveConfigAndValidateNewFormat(t, config, tmpHome)
Expand Down Expand Up @@ -214,9 +213,8 @@ func TestOldJSON(t *testing.T) {
assert.NilError(t, err)

ac := config.AuthConfigs["https://index.docker.io/v1/"]
if ac.Username != "joejoe" || ac.Password != "hello" {
t.Fatalf("Missing data from parsing:\n%q", config)
}
assert.Equal(t, ac.Username, "joejoe")
assert.Equal(t, ac.Password, "hello")

// Now save it and make sure it shows up in new form
configStr := saveConfigAndValidateNewFormat(t, config, tmpHome)
Expand Down Expand Up @@ -250,9 +248,8 @@ func TestNewJSON(t *testing.T) {
assert.NilError(t, err)

ac := config.AuthConfigs["https://index.docker.io/v1/"]
if ac.Username != "joejoe" || ac.Password != "hello" {
t.Fatalf("Missing data from parsing:\n%q", config)
}
assert.Equal(t, ac.Username, "joejoe")
assert.Equal(t, ac.Password, "hello")

// Now save it and make sure it shows up in new form
configStr := saveConfigAndValidateNewFormat(t, config, tmpHome)
Expand Down Expand Up @@ -285,9 +282,8 @@ func TestNewJSONNoEmail(t *testing.T) {
assert.NilError(t, err)

ac := config.AuthConfigs["https://index.docker.io/v1/"]
if ac.Username != "joejoe" || ac.Password != "hello" {
t.Fatalf("Missing data from parsing:\n%q", config)
}
assert.Equal(t, ac.Username, "joejoe")
assert.Equal(t, ac.Password, "hello")

// Now save it and make sure it shows up in new form
configStr := saveConfigAndValidateNewFormat(t, config, tmpHome)
Expand Down Expand Up @@ -432,10 +428,8 @@ func TestJSONReaderNoFile(t *testing.T) {
assert.NilError(t, err)

ac := config.AuthConfigs["https://index.docker.io/v1/"]
if ac.Username != "joejoe" || ac.Password != "hello" {
t.Fatalf("Missing data from parsing:\n%q", config)
}

assert.Equal(t, ac.Username, "joejoe")
assert.Equal(t, ac.Password, "hello")
}

func TestOldJSONReaderNoFile(t *testing.T) {
Expand All @@ -445,9 +439,8 @@ func TestOldJSONReaderNoFile(t *testing.T) {
assert.NilError(t, err)

ac := config.AuthConfigs["https://index.docker.io/v1/"]
if ac.Username != "joejoe" || ac.Password != "hello" {
t.Fatalf("Missing data from parsing:\n%q", config)
}
assert.Equal(t, ac.Username, "joejoe")
assert.Equal(t, ac.Password, "hello")
}

func TestJSONWithPsFormatNoFile(t *testing.T) {
Expand Down

0 comments on commit c3fc547

Please sign in to comment.