mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-04 15:16:58 +00:00
linter(testifylint): use Len or Empty for arrays testing (#7555)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@@ -219,16 +219,16 @@ func TestReconcileOfSchedule(t *testing.T) {
|
||||
// new backup shouldn't be submitted.
|
||||
if test.backup != nil &&
|
||||
(test.backup.Status.Phase == velerov1.BackupPhaseNew || test.backup.Status.Phase == velerov1.BackupPhaseInProgress) {
|
||||
assert.Equal(t, 1, len(backups.Items))
|
||||
assert.Len(t, backups.Items, 1)
|
||||
require.Nil(t, client.Delete(ctx, test.backup))
|
||||
}
|
||||
|
||||
require.Nil(t, client.List(ctx, backups))
|
||||
|
||||
if test.expectedBackupCreate == nil {
|
||||
assert.Equal(t, 0, len(backups.Items))
|
||||
assert.Empty(t, backups.Items)
|
||||
} else {
|
||||
assert.Equal(t, 1, len(backups.Items))
|
||||
assert.Len(t, backups.Items, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user