There are so many fixes

This commit is contained in:
harryzcy 2022-10-30 15:46:42 -04:00
parent 0ff93b83ec
commit 37c59c9136
No known key found for this signature in database
GPG key ID: CC2953E050C19686
3 changed files with 3 additions and 3 deletions

View file

@ -28,7 +28,7 @@ func TestAPIGetRawFileOrLFS(t *testing.T) {
// Test with LFS
onGiteaRun(t, func(t *testing.T, u *url.URL) {
httpContext := NewAPITestContext(t, "user2", "repo-lfs-test", "repo")
httpContext := NewAPITestContext(t, "user2", "repo-lfs-test", "repo", "delete_repo")
doAPICreateRepository(httpContext, false, func(t *testing.T, repository api.Repository) {
u.Path = httpContext.GitPath()
dstPath := t.TempDir()

View file

@ -446,7 +446,7 @@ func TestAPIOrgRepoCreate(t *testing.T) {
for _, testCase := range testCases {
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: testCase.ctxUserID})
session := loginUser(t, user.Name)
token := getTokenForLoggedInUser(t, session, "repo")
token := getTokenForLoggedInUser(t, session, "admin_org")
req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/org/%s/repos?token="+token, testCase.orgName), &api.CreateRepoOption{
Name: testCase.repoName,
})

View file

@ -166,7 +166,7 @@ func testKeyOnlyOneType(t *testing.T, u *url.URL) {
otherSSHURL := createSSHUrl(otherCtx.GitPath(), u)
dstOtherPath := t.TempDir()
t.Run("DeleteRepository", doAPIDeleteRepository(ctx))
t.Run("DeleteRepository", doAPIDeleteRepository(ctxWithDeleteRepo))
t.Run("FailToCreateUserKeyAsStillDeploy", doAPICreateUserKey(failCtx, keyname, keyFile))