aboutsummaryrefslogtreecommitdiffstats
path: root/models/unit_tests.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-12-25 09:59:32 +0000
committerGitHub <noreply@github.com>2020-12-25 11:59:32 +0200
commita19447aed128ecadfcd938d6a80cd4951af1f4ce (patch)
tree6312bf946d601aab29731645a4777feeaea66036 /models/unit_tests.go
parent04ae0f2f3f4556c6d0b4adc5f2cffd0cc7d25151 (diff)
downloadgitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.tar.gz
gitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.zip
migrate from com.* to alternatives (#14103)
* remove github.com/unknwon/com from models * dont use "com.ToStr()" * replace "com.ToStr" with "fmt.Sprint" where its easy to do * more refactor * fix test * just "proxy" Copy func for now * as per @lunny
Diffstat (limited to 'models/unit_tests.go')
-rw-r--r--models/unit_tests.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/models/unit_tests.go b/models/unit_tests.go
index 7254cbf66b..3299630634 100644
--- a/models/unit_tests.go
+++ b/models/unit_tests.go
@@ -19,7 +19,6 @@ import (
"code.gitea.io/gitea/modules/util"
"github.com/stretchr/testify/assert"
- "github.com/unknwon/com"
"xorm.io/xorm"
"xorm.io/xorm/names"
)
@@ -82,8 +81,8 @@ func MainTest(m *testing.M, pathToGiteaRoot string) {
if err = util.RemoveAll(setting.RepoRootPath); err != nil {
fatalTestError("util.RemoveAll: %v\n", err)
}
- if err = com.CopyDir(filepath.Join(pathToGiteaRoot, "integrations", "gitea-repositories-meta"), setting.RepoRootPath); err != nil {
- fatalTestError("com.CopyDir: %v\n", err)
+ if err = util.CopyDir(filepath.Join(pathToGiteaRoot, "integrations", "gitea-repositories-meta"), setting.RepoRootPath); err != nil {
+ fatalTestError("util.CopyDir: %v\n", err)
}
exitStatus := m.Run()
@@ -126,7 +125,7 @@ func PrepareTestEnv(t testing.TB) {
assert.NoError(t, PrepareTestDatabase())
assert.NoError(t, util.RemoveAll(setting.RepoRootPath))
metaPath := filepath.Join(giteaRoot, "integrations", "gitea-repositories-meta")
- assert.NoError(t, com.CopyDir(metaPath, setting.RepoRootPath))
+ assert.NoError(t, util.CopyDir(metaPath, setting.RepoRootPath))
base.SetupGiteaRoot() // Makes sure GITEA_ROOT is set
}