5
5
package models
6
6
7
7
import (
8
+ "path/filepath"
8
9
"testing"
9
10
11
+ "code.gitea.io/gitea/modules/setting"
12
+
10
13
"github.com/stretchr/testify/assert"
11
14
)
12
15
@@ -33,13 +36,15 @@ func TestRepository_UncycloCloneLink(t *testing.T) {
33
36
34
37
func TestUncycloPath (t * testing.T ) {
35
38
assert .NoError (t , PrepareTestDatabase ())
36
- assert .Equal (t , "/repos/user2/repo1.wiki.git" , UncycloPath ("user2" , "repo1" ))
39
+ expected := filepath .Join (setting .RepoRootPath , "user2/repo1.wiki.git" )
40
+ assert .Equal (t , expected , UncycloPath ("user2" , "repo1" ))
37
41
}
38
42
39
43
func TestRepository_UncycloPath (t * testing.T ) {
40
44
assert .NoError (t , PrepareTestDatabase ())
41
45
repo := AssertExistsAndLoadBean (t , & Repository {ID : 1 }).(* Repository )
42
- assert .Equal (t , "/repos/user2/repo1.wiki.git" , repo .UncycloPath ())
46
+ expected := filepath .Join (setting .RepoRootPath , "user2/repo1.wiki.git" )
47
+ assert .Equal (t , expected , repo .UncycloPath ())
43
48
}
44
49
45
50
// TODO TestRepository_HasUncyclo
@@ -49,7 +54,8 @@ func TestRepository_UncycloPath(t *testing.T) {
49
54
func TestRepository_LocalUncycloPath (t * testing.T ) {
50
55
assert .NoError (t , PrepareTestDatabase ())
51
56
repo := AssertExistsAndLoadBean (t , & Repository {ID : 1 }).(* Repository )
52
- assert .Equal (t , "/appdata/tmp/local-wiki/1" , repo .LocalUncycloPath ())
57
+ expected := filepath .Join (setting .AppDataPath , "tmp/local-wiki/1" )
58
+ assert .Equal (t , expected , repo .LocalUncycloPath ())
53
59
}
54
60
55
61
// TODO TestRepository_UpdateLocalUncyclo
0 commit comments