mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 20:36:07 +01:00 
			
		
		
		
	Enable tenv and testifylint rules (#32852)
Enables tenv and testifylint linters closes: https://github.com/go-gitea/gitea/issues/32842
This commit is contained in:
		@@ -8,7 +8,6 @@ import (
 | 
			
		||||
	"io"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/http/httptest"
 | 
			
		||||
	"regexp"
 | 
			
		||||
	"testing"
 | 
			
		||||
 | 
			
		||||
	"code.gitea.io/gitea/models/db"
 | 
			
		||||
@@ -28,9 +27,9 @@ func TestActivityPubSignedPost(t *testing.T) {
 | 
			
		||||
 | 
			
		||||
	expected := "BODY"
 | 
			
		||||
	srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
		assert.Regexp(t, regexp.MustCompile("^"+setting.Federation.DigestAlgorithm), r.Header.Get("Digest"))
 | 
			
		||||
		assert.Regexp(t, "^"+setting.Federation.DigestAlgorithm, r.Header.Get("Digest"))
 | 
			
		||||
		assert.Contains(t, r.Header.Get("Signature"), pubID)
 | 
			
		||||
		assert.Equal(t, r.Header.Get("Content-Type"), ActivityStreamsContentType)
 | 
			
		||||
		assert.Equal(t, ActivityStreamsContentType, r.Header.Get("Content-Type"))
 | 
			
		||||
		body, err := io.ReadAll(r.Body)
 | 
			
		||||
		assert.NoError(t, err)
 | 
			
		||||
		assert.Equal(t, expected, string(body))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user