mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-07 13:55:20 +00:00
fix require-error rule from testifylint
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@@ -51,7 +51,7 @@ func TestIsHostPathVolume(t *testing.T) {
|
||||
},
|
||||
}
|
||||
isHostPath, err := isHostPathVolume(vol, nil, nil)
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
assert.True(t, isHostPath)
|
||||
|
||||
// non-hostPath pod volume
|
||||
@@ -61,7 +61,7 @@ func TestIsHostPathVolume(t *testing.T) {
|
||||
},
|
||||
}
|
||||
isHostPath, err = isHostPathVolume(vol, nil, nil)
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
assert.False(t, isHostPath)
|
||||
|
||||
// PVC that doesn't have a PV
|
||||
@@ -79,7 +79,7 @@ func TestIsHostPathVolume(t *testing.T) {
|
||||
},
|
||||
}
|
||||
isHostPath, err = isHostPathVolume(vol, pvc, nil)
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
assert.False(t, isHostPath)
|
||||
|
||||
// PVC that claims a non-hostPath PV
|
||||
@@ -107,7 +107,7 @@ func TestIsHostPathVolume(t *testing.T) {
|
||||
}
|
||||
crClient1 := velerotest.NewFakeControllerRuntimeClient(t, pv)
|
||||
isHostPath, err = isHostPathVolume(vol, pvc, crClient1)
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
assert.False(t, isHostPath)
|
||||
|
||||
// PVC that claims a hostPath PV
|
||||
@@ -140,7 +140,7 @@ func TestIsHostPathVolume(t *testing.T) {
|
||||
crClient2 := velerotest.NewFakeControllerRuntimeClient(t, pv)
|
||||
|
||||
isHostPath, err = isHostPathVolume(vol, pvc, crClient2)
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
assert.True(t, isHostPath)
|
||||
}
|
||||
|
||||
@@ -588,10 +588,10 @@ func TestBackupPodVolumes(t *testing.T) {
|
||||
pvbs, _, errs := bp.BackupPodVolumes(backupObj, test.sourcePod, test.volumes, nil, velerotest.NewLogger())
|
||||
|
||||
if test.errs == nil {
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
} else {
|
||||
for i := 0; i < len(errs); i++ {
|
||||
assert.EqualError(t, errs[i], test.errs[i])
|
||||
require.EqualError(t, errs[i], test.errs[i])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user