From 6d1895a8b6c09e5ae21ae73c1082eb665cb15105 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 14 Mar 2024 12:46:19 +0000 Subject: [PATCH] improve getExpectedGiteaContentsResponse --- services/repository/files/content_test.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/services/repository/files/content_test.go b/services/repository/files/content_test.go index 55604ca1e3748..5a06e0d022cca 100644 --- a/services/repository/files/content_test.go +++ b/services/repository/files/content_test.go @@ -23,8 +23,6 @@ func TestMain(m *testing.M) { func getExpectedGiteaContentsResponse() *api.ContentsResponse { treePath := ".gitea" sha := "b5f7dda5e39c1eef0d4da9c20b7d8322daa7add5" - encoding := "" - content := "" selfURL := "https://try.gitea.io/api/v1/repos/user2/repo1/contents/" + treePath + "?ref=master" htmlURL := "https://try.gitea.io/user2/repo1/src/branch/master/" + treePath gitURL := "https://try.gitea.io/api/v1/repos/user2/repo1/git/blobs/" + sha @@ -36,8 +34,6 @@ func getExpectedGiteaContentsResponse() *api.ContentsResponse { LastCommitSHA: "94dc45d6ec51090b36c4d5bd5d9e6f5a70da9edf", Type: "dir", Size: 0, - Encoding: &encoding, - Content: &content, URL: &selfURL, HTMLURL: &htmlURL, GitURL: &gitURL, @@ -127,9 +123,6 @@ func TestGetContentsOrListForDir(t *testing.T) { readmeContentsResponse.Content = nil giteaContentsResponse := getExpectedGiteaContentsResponse() - // because will be in a list, doesn't have encoding and content - giteaContentsResponse.Encoding = nil - giteaContentsResponse.Content = nil // because .gitea is a directory, doesn't have download url giteaContentsResponse.DownloadURL = nil