enable linter testifylint on v7 (#4572)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4572
Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
This commit is contained in:
TheFox0x7 2024-07-30 19:42:06 +00:00 committed by Earl Warren
parent c47bdf436b
commit 072dd9f8bc
494 changed files with 4897 additions and 4554 deletions

View file

@ -14,6 +14,7 @@ import (
"code.gitea.io/gitea/modules/json"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestBasicTransferAdapterName(t *testing.T) {
@ -39,7 +40,7 @@ func TestBasicTransferAdapter(t *testing.T) {
assert.Equal(t, "application/octet-stream", req.Header.Get("Content-Type"))
b, err := io.ReadAll(req.Body)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, "dummy", string(b))
return &http.Response{StatusCode: http.StatusOK}
@ -49,7 +50,7 @@ func TestBasicTransferAdapter(t *testing.T) {
var vp Pointer
err := json.NewDecoder(req.Body).Decode(&vp)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, p.Oid, vp.Oid)
assert.Equal(t, p.Size, vp.Size)
@ -98,7 +99,7 @@ func TestBasicTransferAdapter(t *testing.T) {
if len(c.expectederror) > 0 {
assert.True(t, strings.Contains(err.Error(), c.expectederror), "case %d: '%s' should contain '%s'", n, err.Error(), c.expectederror)
} else {
assert.NoError(t, err, "case %d", n)
require.NoError(t, err, "case %d", n)
}
}
})
@ -131,7 +132,7 @@ func TestBasicTransferAdapter(t *testing.T) {
if len(c.expectederror) > 0 {
assert.True(t, strings.Contains(err.Error(), c.expectederror), "case %d: '%s' should contain '%s'", n, err.Error(), c.expectederror)
} else {
assert.NoError(t, err, "case %d", n)
require.NoError(t, err, "case %d", n)
}
}
})
@ -164,7 +165,7 @@ func TestBasicTransferAdapter(t *testing.T) {
if len(c.expectederror) > 0 {
assert.True(t, strings.Contains(err.Error(), c.expectederror), "case %d: '%s' should contain '%s'", n, err.Error(), c.expectederror)
} else {
assert.NoError(t, err, "case %d", n)
require.NoError(t, err, "case %d", n)
}
}
})