Skip to content

Commit

Permalink
chore(test): modify test
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaving authored and Vampouille committed Oct 17, 2024
1 parent 2a9b51d commit 1b54930
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ func TestIsBackupNeededBackupIntervalStatusSuccess(t *testing.T) {
}

h, _ := time.ParseDuration("30m")
assert.Equal(t, isBackupNeeded(givenVolume, h), true)
d, _ := time.ParseDuration("0s") // default prefered time
assert.Equal(t, isBackupNeeded(givenVolume, h,d), true)
h, _ = time.ParseDuration("12h")
assert.Equal(t, isBackupNeeded(givenVolume, h), false)
assert.Equal(t, isBackupNeeded(givenVolume, h,d), false)
}

func TestIsBackupNeededBackupIntervalStatusFailed(t *testing.T) {
Expand All @@ -35,7 +36,8 @@ func TestIsBackupNeededBackupIntervalStatusFailed(t *testing.T) {
}

h, _ := time.ParseDuration("30m")
assert.Equal(t, isBackupNeeded(givenVolume, h), true)
d, _ := time.ParseDuration("0s") // default prefered time
assert.Equal(t, isBackupNeeded(givenVolume, h,d), true)
h, _ = time.ParseDuration("12h")
assert.Equal(t, isBackupNeeded(givenVolume, h), true)
assert.Equal(t, isBackupNeeded(givenVolume, h,d), true)
}

0 comments on commit 1b54930

Please sign in to comment.