testifylint: enable more rules (#8024)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2024-07-18 10:43:16 -04:00
committed by GitHub
parent 55e027897c
commit c8baaa9b11
31 changed files with 61 additions and 64 deletions
+2 -2
View File
@@ -138,7 +138,7 @@ func TestCreateOptions_OrderedResources(t *testing.T) {
"pods": "ns1/p1,ns1/p2",
"persistentvolumeclaims": "ns2/pvc1,ns2/pvc2",
}
assert.Equal(t, orderedResources, expectedResources)
assert.Equal(t, expectedResources, orderedResources)
orderedResources, err = ParseOrderedResources("pods= ns1/p1,ns1/p2 ; persistentvolumes=pv1,pv2")
assert.NoError(t, err)
@@ -147,7 +147,7 @@ func TestCreateOptions_OrderedResources(t *testing.T) {
"pods": "ns1/p1,ns1/p2",
"persistentvolumes": "pv1,pv2",
}
assert.Equal(t, orderedResources, expectedMixedResources)
assert.Equal(t, expectedMixedResources, orderedResources)
}
func TestCreateCommand(t *testing.T) {
+1 -1
View File
@@ -79,7 +79,7 @@ func TestNewLogsCommand(t *testing.T) {
err = l.Run(c, f)
require.Error(t, err)
require.Contains(t, err.Error(), fmt.Sprintf("logs for backup \"%s\" are not available until it's finished processing", backupName))
require.ErrorContains(t, err, fmt.Sprintf("logs for backup \"%s\" are not available until it's finished processing", backupName))
})
t.Run("Backup not exist test", func(t *testing.T) {
+2 -3
View File
@@ -20,7 +20,6 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"testing"
"github.com/pkg/errors"
@@ -166,7 +165,7 @@ func Test_getDataPathConfigs(t *testing.T) {
if test.expectLog == "" {
assert.Equal(t, "", logBuffer)
} else {
assert.True(t, strings.Contains(logBuffer, test.expectLog))
assert.Contains(t, logBuffer, test.expectLog)
}
})
}
@@ -384,7 +383,7 @@ func Test_getDataPathConcurrentNum(t *testing.T) {
if test.expectLog == "" {
assert.Equal(t, "", logBuffer)
} else {
assert.True(t, strings.Contains(logBuffer, test.expectLog))
assert.Contains(t, logBuffer, test.expectLog)
}
})
}