Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
Refactore test
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Kralik committed Feb 28, 2024
1 parent ded2d9c commit 9eeb4b9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/upgrade/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func TestUpgrade_canUpgrade(t *testing.T) {
name string
everestVersion string
versionMeta *version.MetadataResponse
wantErr bool
wantErrIs error
wantUpgradeTo string
}{
Expand Down Expand Up @@ -76,7 +75,6 @@ func TestUpgrade_canUpgrade(t *testing.T) {
{Version: "0.7.0"},
},
},
wantErr: true,
wantErrIs: ErrNoUpdateAvailable,
},
{
Expand Down Expand Up @@ -149,16 +147,12 @@ func TestUpgrade_canUpgrade(t *testing.T) {
everestClient: ecl,
}
upgradeTo, _, err := u.canUpgrade(context.Background())
if (err != nil) != tt.wantErr {
t.Errorf("Upgrade.canUpgrade() error = %v, wantErr %v", err, tt.wantErr)
return
}
if err != nil && !errors.Is(err, tt.wantErrIs) {
t.Errorf("error = %v, wantErrIs %v", err, tt.wantErrIs)
return
}

if tt.wantErr {
if err != nil {
return
}

Expand Down

0 comments on commit 9eeb4b9

Please sign in to comment.