From 86877aef4b69fccfbb3ccde0400c8950c8ac494f Mon Sep 17 00:00:00 2001 From: HFO4 <912394456@qq.com> Date: Wed, 20 Apr 2022 18:59:09 +0800 Subject: [PATCH] fix: failed ut --- pkg/filesystem/archive_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/filesystem/archive_test.go b/pkg/filesystem/archive_test.go index fc61520..0bbb179 100644 --- a/pkg/filesystem/archive_test.go +++ b/pkg/filesystem/archive_test.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "errors" - "github.com/cloudreve/Cloudreve/v3/pkg/request" "github.com/cloudreve/Cloudreve/v3/pkg/util" testMock "github.com/stretchr/testify/mock" "io" @@ -173,7 +172,7 @@ func TestFileSystem_Decompress(t *testing.T) { fs.FileTarget = []model.File{{SourceName: "1.zip", Policy: model.Policy{Type: "mock"}}} fs.FileTarget[0].Policy.ID = 1 testHandler := new(FileHeaderMock) - testHandler.On("Get", testMock.Anything, "1.zip").Return(request.NopRSCloser{}, errors.New("error")) + testHandler.On("Get", testMock.Anything, "1.zip").Return(MockRSC{}, errors.New("error")) fs.Handler = testHandler err := fs.Decompress(ctx, "/1.zip", "/") asserts.NoError(mock.ExpectationsWereMet()) @@ -187,7 +186,7 @@ func TestFileSystem_Decompress(t *testing.T) { fs.FileTarget = []model.File{{SourceName: "1.zip", Policy: model.Policy{Type: "mock"}}} fs.FileTarget[0].Policy.ID = 1 testHandler := new(FileHeaderMock) - testHandler.On("Get", testMock.Anything, "1.zip").Return(request.NopRSCloser{}, nil) + testHandler.On("Get", testMock.Anything, "1.zip").Return(MockRSC{}, nil) fs.Handler = testHandler err := fs.Decompress(ctx, "/1.zip", "/") asserts.NoError(mock.ExpectationsWereMet())