diff options
Diffstat (limited to 'integrations/pull_update_test.go')
-rw-r--r-- | integrations/pull_update_test.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/integrations/pull_update_test.go b/integrations/pull_update_test.go index b80b85fbeb..dc2803aca0 100644 --- a/integrations/pull_update_test.go +++ b/integrations/pull_update_test.go @@ -23,12 +23,12 @@ import ( func TestAPIPullUpdate(t *testing.T) { onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) { - //Create PR to test + // Create PR to test user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}).(*user_model.User) org26 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 26}).(*user_model.User) pr := createOutdatedPR(t, user, org26) - //Test GetDiverging + // Test GetDiverging diffCount, err := pull_service.GetDiverging(git.DefaultContext, pr) assert.NoError(t, err) assert.EqualValues(t, 1, diffCount.Behind) @@ -41,7 +41,7 @@ func TestAPIPullUpdate(t *testing.T) { req := NewRequestf(t, "POST", "/api/v1/repos/%s/%s/pulls/%d/update?token="+token, pr.BaseRepo.OwnerName, pr.BaseRepo.Name, pr.Issue.Index) session.MakeRequest(t, req, http.StatusOK) - //Test GetDiverging after update + // Test GetDiverging after update diffCount, err = pull_service.GetDiverging(git.DefaultContext, pr) assert.NoError(t, err) assert.EqualValues(t, 0, diffCount.Behind) @@ -51,12 +51,12 @@ func TestAPIPullUpdate(t *testing.T) { func TestAPIPullUpdateByRebase(t *testing.T) { onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) { - //Create PR to test + // Create PR to test user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}).(*user_model.User) org26 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 26}).(*user_model.User) pr := createOutdatedPR(t, user, org26) - //Test GetDiverging + // Test GetDiverging diffCount, err := pull_service.GetDiverging(git.DefaultContext, pr) assert.NoError(t, err) assert.EqualValues(t, 1, diffCount.Behind) @@ -69,7 +69,7 @@ func TestAPIPullUpdateByRebase(t *testing.T) { req := NewRequestf(t, "POST", "/api/v1/repos/%s/%s/pulls/%d/update?style=rebase&token="+token, pr.BaseRepo.OwnerName, pr.BaseRepo.Name, pr.Issue.Index) session.MakeRequest(t, req, http.StatusOK) - //Test GetDiverging after update + // Test GetDiverging after update diffCount, err = pull_service.GetDiverging(git.DefaultContext, pr) assert.NoError(t, err) assert.EqualValues(t, 0, diffCount.Behind) @@ -98,7 +98,7 @@ func createOutdatedPR(t *testing.T, actor, forkOrg *user_model.User) *models.Pul assert.NoError(t, err) assert.NotEmpty(t, headRepo) - //create a commit on base Repo + // create a commit on base Repo _, err = files_service.CreateOrUpdateRepoFile(git.DefaultContext, baseRepo, actor, &files_service.UpdateRepoFileOptions{ TreePath: "File_A", Message: "Add File A", @@ -121,7 +121,7 @@ func createOutdatedPR(t *testing.T, actor, forkOrg *user_model.User) *models.Pul }) assert.NoError(t, err) - //create a commit on head Repo + // create a commit on head Repo _, err = files_service.CreateOrUpdateRepoFile(git.DefaultContext, headRepo, actor, &files_service.UpdateRepoFileOptions{ TreePath: "File_B", Message: "Add File on PR branch", @@ -144,7 +144,7 @@ func createOutdatedPR(t *testing.T, actor, forkOrg *user_model.User) *models.Pul }) assert.NoError(t, err) - //create Pull + // create Pull pullIssue := &models.Issue{ RepoID: baseRepo.ID, Title: "Test Pull -to-update-", |