summaryrefslogtreecommitdiffstats
path: root/tests/integration/git_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/git_test.go')
-rw-r--r--tests/integration/git_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/integration/git_test.go b/tests/integration/git_test.go
index f7e1e04b1e..a11bad21b7 100644
--- a/tests/integration/git_test.go
+++ b/tests/integration/git_test.go
@@ -16,6 +16,7 @@ import (
"testing"
"time"
+ auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
issues_model "code.gitea.io/gitea/models/issues"
"code.gitea.io/gitea/models/perm"
@@ -42,11 +43,11 @@ func TestGit(t *testing.T) {
func testGit(t *testing.T, u *url.URL) {
username := "user2"
- baseAPITestContext := NewAPITestContext(t, username, "repo1")
+ baseAPITestContext := NewAPITestContext(t, username, "repo1", auth_model.AccessTokenScopeRepo, auth_model.AccessTokenScopeWritePublicKey, auth_model.AccessTokenScopeDeleteRepo)
u.Path = baseAPITestContext.GitPath()
- forkedUserCtx := NewAPITestContext(t, "user4", "repo1")
+ forkedUserCtx := NewAPITestContext(t, "user4", "repo1", auth_model.AccessTokenScopeRepo)
t.Run("HTTP", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
@@ -357,7 +358,7 @@ func doBranchProtectPRMerge(baseCtx *APITestContext, dstPath string) func(t *tes
t.Run("CreateBranchProtected", doGitCreateBranch(dstPath, "protected"))
t.Run("PushProtectedBranch", doGitPushTestRepository(dstPath, "origin", "protected"))
- ctx := NewAPITestContext(t, baseCtx.Username, baseCtx.Reponame)
+ ctx := NewAPITestContext(t, baseCtx.Username, baseCtx.Reponame, auth_model.AccessTokenScopeRepo)
t.Run("ProtectProtectedBranchNoWhitelist", doProtectBranch(ctx, "protected", "", ""))
t.Run("GenerateCommit", func(t *testing.T) {
_, err := generateCommitWithNewData(littleSize, dstPath, "user2@example.com", "User Two", "branch-data-file-")
@@ -601,7 +602,7 @@ func doAutoPRMerge(baseCtx *APITestContext, dstPath string) func(t *testing.T) {
return func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
- ctx := NewAPITestContext(t, baseCtx.Username, baseCtx.Reponame)
+ ctx := NewAPITestContext(t, baseCtx.Username, baseCtx.Reponame, auth_model.AccessTokenScopeRepo)
t.Run("CheckoutProtected", doGitCheckoutBranch(dstPath, "protected"))
t.Run("PullProtected", doGitPull(dstPath, "origin", "protected"))