Skip to content

Commit abe1cf3

Browse files
committed
Add test
1 parent 6f5bc59 commit abe1cf3

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

services/repository/files/file_test.go

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package files
55

66
import (
77
"testing"
8+
"time"
89

910
"code.gitea.io/gitea/models/unittest"
1011
"code.gitea.io/gitea/modules/gitrepo"
@@ -42,18 +43,19 @@ func getExpectedFileResponse() *api.FileResponse {
4243
downloadURL := setting.AppURL + "user2/repo1/raw/branch/master/" + treePath
4344
return &api.FileResponse{
4445
Content: &api.ContentsResponse{
45-
Name: treePath,
46-
Path: treePath,
47-
SHA: sha,
48-
LastCommitSHA: "65f1bf27bc3bf70f64657658635e66094edbcb4d",
49-
Type: "file",
50-
Size: 30,
51-
Encoding: &encoding,
52-
Content: &content,
53-
URL: &selfURL,
54-
HTMLURL: &htmlURL,
55-
GitURL: &gitURL,
56-
DownloadURL: &downloadURL,
46+
Name: treePath,
47+
Path: treePath,
48+
SHA: sha,
49+
LastCommitSHA: "65f1bf27bc3bf70f64657658635e66094edbcb4d",
50+
LastCommitWhen: time.Date(2017, 3, 19, 16, 47, 59, 0, time.FixedZone("", -4)),
51+
Type: "file",
52+
Size: 30,
53+
Encoding: &encoding,
54+
Content: &content,
55+
URL: &selfURL,
56+
HTMLURL: &htmlURL,
57+
GitURL: &gitURL,
58+
DownloadURL: &downloadURL,
5759
Links: &api.FileLinksResponse{
5860
Self: &selfURL,
5961
GitURL: &gitURL,

0 commit comments

Comments
 (0)