mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Use gitrepo.Repository instead of wikipath (#35398)
Now the wikipath will not be referenced directly.
This commit is contained in:
		| @@ -4,12 +4,10 @@ | ||||
| package repo_test | ||||
|  | ||||
| import ( | ||||
| 	"path/filepath" | ||||
| 	"testing" | ||||
|  | ||||
| 	repo_model "code.gitea.io/gitea/models/repo" | ||||
| 	"code.gitea.io/gitea/models/unittest" | ||||
| 	"code.gitea.io/gitea/modules/setting" | ||||
|  | ||||
| 	"github.com/stretchr/testify/assert" | ||||
| ) | ||||
| @@ -23,15 +21,10 @@ func TestRepository_WikiCloneLink(t *testing.T) { | ||||
| 	assert.Equal(t, "https://try.gitea.io/user2/repo1.wiki.git", cloneLink.HTTPS) | ||||
| } | ||||
|  | ||||
| func TestWikiPath(t *testing.T) { | ||||
| func TestRepository_RelativeWikiPath(t *testing.T) { | ||||
| 	assert.NoError(t, unittest.PrepareTestDatabase()) | ||||
| 	expected := filepath.Join(setting.RepoRootPath, "user2/repo1.wiki.git") | ||||
| 	assert.Equal(t, expected, repo_model.WikiPath("user2", "repo1")) | ||||
| } | ||||
|  | ||||
| func TestRepository_WikiPath(t *testing.T) { | ||||
| 	assert.NoError(t, unittest.PrepareTestDatabase()) | ||||
| 	repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}) | ||||
| 	expected := filepath.Join(setting.RepoRootPath, "user2/repo1.wiki.git") | ||||
| 	assert.Equal(t, expected, repo.WikiPath()) | ||||
| 	assert.Equal(t, "user2/repo1.wiki.git", repo_model.RelativeWikiPath(repo.OwnerName, repo.Name)) | ||||
| 	assert.Equal(t, "user2/repo1.wiki.git", repo.WikiStorageRepo().RelativePath()) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user