mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 11:45:20 +00:00
fix require-error rule from testifylint
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
appsv1api "k8s.io/api/apps/v1"
|
||||
corev1api "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -232,7 +233,7 @@ func TestGetPodSpec(t *testing.T) {
|
||||
|
||||
spec, err := GetPodSpec(context.TODO(), fakeKubeClient, test.namespace, kube.NodeOSLinux)
|
||||
if test.expectErr == "" {
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, *spec, test.expectSpec)
|
||||
} else {
|
||||
assert.EqualError(t, err, test.expectErr)
|
||||
@@ -317,7 +318,7 @@ func TestGetConfigs(t *testing.T) {
|
||||
|
||||
result, err := GetConfigs(context.TODO(), test.namespace, fakeKubeClient, "node-agent-config")
|
||||
if test.expectErr == "" {
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
|
||||
if test.expectResult == nil {
|
||||
assert.Nil(t, result)
|
||||
@@ -453,7 +454,7 @@ func TestGetLabelValue(t *testing.T) {
|
||||
|
||||
value, err := GetLabelValue(context.TODO(), fakeKubeClient, test.namespace, "fake-label", kube.NodeOSLinux)
|
||||
if test.expectErr == "" {
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, test.expectedValue, value)
|
||||
} else {
|
||||
assert.EqualError(t, err, test.expectErr)
|
||||
@@ -582,7 +583,7 @@ func TestGetAnnotationValue(t *testing.T) {
|
||||
|
||||
value, err := GetAnnotationValue(context.TODO(), fakeKubeClient, test.namespace, "fake-annotation", kube.NodeOSLinux)
|
||||
if test.expectErr == "" {
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, test.expectedValue, value)
|
||||
} else {
|
||||
assert.EqualError(t, err, test.expectErr)
|
||||
@@ -743,7 +744,7 @@ func TestGetHostPodPath(t *testing.T) {
|
||||
path, err := GetHostPodPath(context.TODO(), fakeKubeClient, test.namespace, test.osType)
|
||||
|
||||
if test.expectErr == "" {
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, test.expectedValue, path)
|
||||
} else {
|
||||
assert.EqualError(t, err, test.expectErr)
|
||||
|
||||
Reference in New Issue
Block a user