diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-12-10 09:27:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-10 09:27:50 +0800 |
commit | 719bddcd76610a63dadc8555760072957a11cf30 (patch) | |
tree | 0df26092fba7e3e21444fe493e6b349473b6b0cb /routers/web/repo/wiki_test.go | |
parent | fb8166c6c6b652a0e6fa98681780a6a71090faf3 (diff) | |
download | gitea-719bddcd76610a63dadc8555760072957a11cf30.tar.gz gitea-719bddcd76610a63dadc8555760072957a11cf30.zip |
Move repository model into models/repo (#17933)
* Some refactors related repository model
* Move more methods out of repository
* Move repository into models/repo
* Fix test
* Fix test
* some improvements
* Remove unnecessary function
Diffstat (limited to 'routers/web/repo/wiki_test.go')
-rw-r--r-- | routers/web/repo/wiki_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/routers/web/repo/wiki_test.go b/routers/web/repo/wiki_test.go index 87f2779c1a..1bfda50d19 100644 --- a/routers/web/repo/wiki_test.go +++ b/routers/web/repo/wiki_test.go @@ -9,7 +9,7 @@ import ( "net/http" "testing" - "code.gitea.io/gitea/models" + repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/test" @@ -23,7 +23,7 @@ import ( const content = "Wiki contents for unit tests" const message = "Wiki commit message for unit tests" -func wikiEntry(t *testing.T, repo *models.Repository, wikiName string) *git.TreeEntry { +func wikiEntry(t *testing.T, repo *repo_model.Repository, wikiName string) *git.TreeEntry { wikiRepo, err := git.OpenRepository(repo.WikiPath()) assert.NoError(t, err) defer wikiRepo.Close() @@ -39,7 +39,7 @@ func wikiEntry(t *testing.T, repo *models.Repository, wikiName string) *git.Tree return nil } -func wikiContent(t *testing.T, repo *models.Repository, wikiName string) string { +func wikiContent(t *testing.T, repo *repo_model.Repository, wikiName string) string { entry := wikiEntry(t, repo, wikiName) if !assert.NotNil(t, entry) { return "" @@ -52,11 +52,11 @@ func wikiContent(t *testing.T, repo *models.Repository, wikiName string) string return string(bytes) } -func assertWikiExists(t *testing.T, repo *models.Repository, wikiName string) { +func assertWikiExists(t *testing.T, repo *repo_model.Repository, wikiName string) { assert.NotNil(t, wikiEntry(t, repo, wikiName)) } -func assertWikiNotExists(t *testing.T, repo *models.Repository, wikiName string) { +func assertWikiNotExists(t *testing.T, repo *repo_model.Repository, wikiName string) { assert.Nil(t, wikiEntry(t, repo, wikiName)) } |