aboutsummaryrefslogtreecommitdiffstats
path: root/services/auth
diff options
context:
space:
mode:
authorTheFox0x7 <thefox0x7@gmail.com>2024-12-15 11:41:29 +0100
committerGitHub <noreply@github.com>2024-12-15 10:41:29 +0000
commit33e8e82c4b528db8efb1cf9fc4dbab2d9e21ace8 (patch)
tree6ee296e2ef469911d0db440100e1eb835945af89 /services/auth
parentdf9a78cd04e364264c103cf3a92d94179cc1dd4f (diff)
downloadgitea-33e8e82c4b528db8efb1cf9fc4dbab2d9e21ace8.tar.gz
gitea-33e8e82c4b528db8efb1cf9fc4dbab2d9e21ace8.zip
Enable tenv and testifylint rules (#32852)
Enables tenv and testifylint linters closes: https://github.com/go-gitea/gitea/issues/32842
Diffstat (limited to 'services/auth')
-rw-r--r--services/auth/oauth2_test.go2
-rw-r--r--services/auth/source/oauth2/source_sync_test.go8
2 files changed, 5 insertions, 5 deletions
diff --git a/services/auth/oauth2_test.go b/services/auth/oauth2_test.go
index 75c231ff7a..b706847e8e 100644
--- a/services/auth/oauth2_test.go
+++ b/services/auth/oauth2_test.go
@@ -28,7 +28,7 @@ func TestUserIDFromToken(t *testing.T) {
o := OAuth2{}
uid := o.userIDFromToken(context.Background(), token, ds)
assert.Equal(t, int64(user_model.ActionsUserID), uid)
- assert.Equal(t, ds["IsActionsToken"], true)
+ assert.Equal(t, true, ds["IsActionsToken"])
assert.Equal(t, ds["ActionsTaskID"], int64(RunningTaskID))
})
}
diff --git a/services/auth/source/oauth2/source_sync_test.go b/services/auth/source/oauth2/source_sync_test.go
index 25408e8727..893ed62502 100644
--- a/services/auth/source/oauth2/source_sync_test.go
+++ b/services/auth/source/oauth2/source_sync_test.go
@@ -64,8 +64,8 @@ func TestSource(t *testing.T) {
ok, err := user_model.GetExternalLogin(context.Background(), e)
assert.NoError(t, err)
assert.True(t, ok)
- assert.Equal(t, e.RefreshToken, "refresh")
- assert.Equal(t, e.AccessToken, "token")
+ assert.Equal(t, "refresh", e.RefreshToken)
+ assert.Equal(t, "token", e.AccessToken)
u, err := user_model.GetUserByID(context.Background(), user.ID)
assert.NoError(t, err)
@@ -89,8 +89,8 @@ func TestSource(t *testing.T) {
ok, err := user_model.GetExternalLogin(context.Background(), e)
assert.NoError(t, err)
assert.True(t, ok)
- assert.Equal(t, e.RefreshToken, "")
- assert.Equal(t, e.AccessToken, "")
+ assert.Equal(t, "", e.RefreshToken)
+ assert.Equal(t, "", e.AccessToken)
u, err := user_model.GetUserByID(context.Background(), user.ID)
assert.NoError(t, err)