aboutsummaryrefslogtreecommitdiffstats
path: root/tests/integration/repofiles_change_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/repofiles_change_test.go')
-rw-r--r--tests/integration/repofiles_change_test.go72
1 files changed, 36 insertions, 36 deletions
diff --git a/tests/integration/repofiles_change_test.go b/tests/integration/repofiles_change_test.go
index 765a44689a..e0edf07299 100644
--- a/tests/integration/repofiles_change_test.go
+++ b/tests/integration/repofiles_change_test.go
@@ -12,10 +12,10 @@ import (
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
+ "code.gitea.io/gitea/modules/contexttest"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
- "code.gitea.io/gitea/modules/test"
files_service "code.gitea.io/gitea/services/repository/files"
"github.com/stretchr/testify/assert"
@@ -245,12 +245,12 @@ func getExpectedFileResponseForRepofilesUpdate(commitID, filename, lastCommitSHA
func TestChangeRepoFilesForCreate(t *testing.T) {
// setup
onGiteaRun(t, func(t *testing.T, u *url.URL) {
- ctx, _ := test.MockContext(t, "user2/repo1")
+ ctx, _ := contexttest.MockContext(t, "user2/repo1")
ctx.SetParams(":id", "1")
- test.LoadRepo(t, ctx, 1)
- test.LoadRepoCommit(t, ctx)
- test.LoadUser(t, ctx, 2)
- test.LoadGitRepo(t, ctx)
+ contexttest.LoadRepo(t, ctx, 1)
+ contexttest.LoadRepoCommit(t, ctx)
+ contexttest.LoadUser(t, ctx, 2)
+ contexttest.LoadGitRepo(t, ctx)
defer ctx.Repo.GitRepo.Close()
repo := ctx.Repo.Repository
@@ -282,12 +282,12 @@ func TestChangeRepoFilesForCreate(t *testing.T) {
func TestChangeRepoFilesForUpdate(t *testing.T) {
// setup
onGiteaRun(t, func(t *testing.T, u *url.URL) {
- ctx, _ := test.MockContext(t, "user2/repo1")
+ ctx, _ := contexttest.MockContext(t, "user2/repo1")
ctx.SetParams(":id", "1")
- test.LoadRepo(t, ctx, 1)
- test.LoadRepoCommit(t, ctx)
- test.LoadUser(t, ctx, 2)
- test.LoadGitRepo(t, ctx)
+ contexttest.LoadRepo(t, ctx, 1)
+ contexttest.LoadRepoCommit(t, ctx)
+ contexttest.LoadUser(t, ctx, 2)
+ contexttest.LoadGitRepo(t, ctx)
defer ctx.Repo.GitRepo.Close()
repo := ctx.Repo.Repository
@@ -316,12 +316,12 @@ func TestChangeRepoFilesForUpdate(t *testing.T) {
func TestChangeRepoFilesForUpdateWithFileMove(t *testing.T) {
// setup
onGiteaRun(t, func(t *testing.T, u *url.URL) {
- ctx, _ := test.MockContext(t, "user2/repo1")
+ ctx, _ := contexttest.MockContext(t, "user2/repo1")
ctx.SetParams(":id", "1")
- test.LoadRepo(t, ctx, 1)
- test.LoadRepoCommit(t, ctx)
- test.LoadUser(t, ctx, 2)
- test.LoadGitRepo(t, ctx)
+ contexttest.LoadRepo(t, ctx, 1)
+ contexttest.LoadRepoCommit(t, ctx)
+ contexttest.LoadUser(t, ctx, 2)
+ contexttest.LoadGitRepo(t, ctx)
defer ctx.Repo.GitRepo.Close()
repo := ctx.Repo.Repository
@@ -367,12 +367,12 @@ func TestChangeRepoFilesForUpdateWithFileMove(t *testing.T) {
func TestChangeRepoFilesWithoutBranchNames(t *testing.T) {
// setup
onGiteaRun(t, func(t *testing.T, u *url.URL) {
- ctx, _ := test.MockContext(t, "user2/repo1")
+ ctx, _ := contexttest.MockContext(t, "user2/repo1")
ctx.SetParams(":id", "1")
- test.LoadRepo(t, ctx, 1)
- test.LoadRepoCommit(t, ctx)
- test.LoadUser(t, ctx, 2)
- test.LoadGitRepo(t, ctx)
+ contexttest.LoadRepo(t, ctx, 1)
+ contexttest.LoadRepoCommit(t, ctx)
+ contexttest.LoadUser(t, ctx, 2)
+ contexttest.LoadGitRepo(t, ctx)
defer ctx.Repo.GitRepo.Close()
repo := ctx.Repo.Repository
@@ -403,12 +403,12 @@ func TestChangeRepoFilesForDelete(t *testing.T) {
func testDeleteRepoFiles(t *testing.T, u *url.URL) {
// setup
unittest.PrepareTestEnv(t)
- ctx, _ := test.MockContext(t, "user2/repo1")
+ ctx, _ := contexttest.MockContext(t, "user2/repo1")
ctx.SetParams(":id", "1")
- test.LoadRepo(t, ctx, 1)
- test.LoadRepoCommit(t, ctx)
- test.LoadUser(t, ctx, 2)
- test.LoadGitRepo(t, ctx)
+ contexttest.LoadRepo(t, ctx, 1)
+ contexttest.LoadRepoCommit(t, ctx)
+ contexttest.LoadUser(t, ctx, 2)
+ contexttest.LoadGitRepo(t, ctx)
defer ctx.Repo.GitRepo.Close()
repo := ctx.Repo.Repository
doer := ctx.Doer
@@ -442,12 +442,12 @@ func TestChangeRepoFilesForDeleteWithoutBranchNames(t *testing.T) {
func testDeleteRepoFilesWithoutBranchNames(t *testing.T, u *url.URL) {
// setup
unittest.PrepareTestEnv(t)
- ctx, _ := test.MockContext(t, "user2/repo1")
+ ctx, _ := contexttest.MockContext(t, "user2/repo1")
ctx.SetParams(":id", "1")
- test.LoadRepo(t, ctx, 1)
- test.LoadRepoCommit(t, ctx)
- test.LoadUser(t, ctx, 2)
- test.LoadGitRepo(t, ctx)
+ contexttest.LoadRepo(t, ctx, 1)
+ contexttest.LoadRepoCommit(t, ctx)
+ contexttest.LoadUser(t, ctx, 2)
+ contexttest.LoadGitRepo(t, ctx)
defer ctx.Repo.GitRepo.Close()
repo := ctx.Repo.Repository
@@ -472,12 +472,12 @@ func testDeleteRepoFilesWithoutBranchNames(t *testing.T, u *url.URL) {
func TestChangeRepoFilesErrors(t *testing.T) {
// setup
onGiteaRun(t, func(t *testing.T, u *url.URL) {
- ctx, _ := test.MockContext(t, "user2/repo1")
+ ctx, _ := contexttest.MockContext(t, "user2/repo1")
ctx.SetParams(":id", "1")
- test.LoadRepo(t, ctx, 1)
- test.LoadRepoCommit(t, ctx)
- test.LoadUser(t, ctx, 2)
- test.LoadGitRepo(t, ctx)
+ contexttest.LoadRepo(t, ctx, 1)
+ contexttest.LoadRepoCommit(t, ctx)
+ contexttest.LoadUser(t, ctx, 2)
+ contexttest.LoadGitRepo(t, ctx)
defer ctx.Repo.GitRepo.Close()
repo := ctx.Repo.Repository