diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-12-10 02:27:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-10 02:27:50 +0100 |
commit | 719bddcd76610a63dadc8555760072957a11cf30 (patch) | |
tree | 0df26092fba7e3e21444fe493e6b349473b6b0cb /modules/indexer/stats/indexer_test.go | |
parent | [skip ci] Updated translations via Crowdin (diff) | |
download | forgejo-719bddcd76610a63dadc8555760072957a11cf30.tar.xz forgejo-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 'modules/indexer/stats/indexer_test.go')
-rw-r--r-- | modules/indexer/stats/indexer_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/indexer/stats/indexer_test.go b/modules/indexer/stats/indexer_test.go index f52d73a32e..b32100b458 100644 --- a/modules/indexer/stats/indexer_test.go +++ b/modules/indexer/stats/indexer_test.go @@ -9,7 +9,8 @@ import ( "testing" "time" - "code.gitea.io/gitea/models" + _ "code.gitea.io/gitea/models" + repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/setting" @@ -32,12 +33,12 @@ func TestRepoStatsIndex(t *testing.T) { time.Sleep(5 * time.Second) - repo, err := models.GetRepositoryByID(1) + repo, err := repo_model.GetRepositoryByID(1) assert.NoError(t, err) - status, err := repo.GetIndexerStatus(models.RepoIndexerTypeStats) + status, err := repo_model.GetIndexerStatus(repo, repo_model.RepoIndexerTypeStats) assert.NoError(t, err) assert.Equal(t, "65f1bf27bc3bf70f64657658635e66094edbcb4d", status.CommitSha) - langs, err := repo.GetTopLanguageStats(5) + langs, err := repo_model.GetTopLanguageStats(repo, 5) assert.NoError(t, err) assert.Empty(t, langs) } |