mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 04:07:50 +01:00
Add test
This commit is contained in:
parent
6f5bc5923e
commit
abe1cf3ff7
@ -5,6 +5,7 @@ package files
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models/unittest"
|
"code.gitea.io/gitea/models/unittest"
|
||||||
"code.gitea.io/gitea/modules/gitrepo"
|
"code.gitea.io/gitea/modules/gitrepo"
|
||||||
@ -42,18 +43,19 @@ func getExpectedFileResponse() *api.FileResponse {
|
|||||||
downloadURL := setting.AppURL + "user2/repo1/raw/branch/master/" + treePath
|
downloadURL := setting.AppURL + "user2/repo1/raw/branch/master/" + treePath
|
||||||
return &api.FileResponse{
|
return &api.FileResponse{
|
||||||
Content: &api.ContentsResponse{
|
Content: &api.ContentsResponse{
|
||||||
Name: treePath,
|
Name: treePath,
|
||||||
Path: treePath,
|
Path: treePath,
|
||||||
SHA: sha,
|
SHA: sha,
|
||||||
LastCommitSHA: "65f1bf27bc3bf70f64657658635e66094edbcb4d",
|
LastCommitSHA: "65f1bf27bc3bf70f64657658635e66094edbcb4d",
|
||||||
Type: "file",
|
LastCommitWhen: time.Date(2017, 3, 19, 16, 47, 59, 0, time.FixedZone("", -4)),
|
||||||
Size: 30,
|
Type: "file",
|
||||||
Encoding: &encoding,
|
Size: 30,
|
||||||
Content: &content,
|
Encoding: &encoding,
|
||||||
URL: &selfURL,
|
Content: &content,
|
||||||
HTMLURL: &htmlURL,
|
URL: &selfURL,
|
||||||
GitURL: &gitURL,
|
HTMLURL: &htmlURL,
|
||||||
DownloadURL: &downloadURL,
|
GitURL: &gitURL,
|
||||||
|
DownloadURL: &downloadURL,
|
||||||
Links: &api.FileLinksResponse{
|
Links: &api.FileLinksResponse{
|
||||||
Self: &selfURL,
|
Self: &selfURL,
|
||||||
GitURL: &gitURL,
|
GitURL: &gitURL,
|
||||||
|
Loading…
Reference in New Issue
Block a user