aboutsummaryrefslogtreecommitdiffstats
path: root/modules/httplib
diff options
context:
space:
mode:
authorTheFox0x7 <thefox0x7@gmail.com>2025-01-09 02:21:47 +0100
committerGitHub <noreply@github.com>2025-01-09 09:21:47 +0800
commit2a02734f93c0091275c77e370b7eed03b2c5f18e (patch)
tree2dcad43764cbfa254f7c6d355f5a14ffdcdb109a /modules/httplib
parentfa9191b7b9373666f30a55bbc63b932833bceefe (diff)
downloadgitea-2a02734f93c0091275c77e370b7eed03b2c5f18e.tar.gz
gitea-2a02734f93c0091275c77e370b7eed03b2c5f18e.zip
Refactor older tests to use testify (#33140)
Refactor checks to use assert/require Use require.Eventually for waiting in elastic and meilisearch tests Use require to exit early instead of assert
Diffstat (limited to 'modules/httplib')
-rw-r--r--modules/httplib/serve_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/httplib/serve_test.go b/modules/httplib/serve_test.go
index c2229dffe9..e53f38b697 100644
--- a/modules/httplib/serve_test.go
+++ b/modules/httplib/serve_test.go
@@ -13,6 +13,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
)
func TestServeContentByReader(t *testing.T) {
@@ -71,9 +72,7 @@ func TestServeContentByReadSeeker(t *testing.T) {
}
seekReader, err := os.OpenFile(tmpFile, os.O_RDONLY, 0o644)
- if !assert.NoError(t, err) {
- return
- }
+ require.NoError(t, err)
defer seekReader.Close()
w := httptest.NewRecorder()