From 13fb090194bfc9b98f5789bf19d8c4879c08f604 Mon Sep 17 00:00:00 2001 From: HFO4 <912394456@qq.com> Date: Thu, 5 Dec 2019 19:10:55 +0800 Subject: [PATCH] Fix: failed unit tests --- pkg/filesystem/local/file_test.go | 2 +- pkg/filesystem/path_test.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/filesystem/local/file_test.go b/pkg/filesystem/local/file_test.go index bf42fca..b368764 100644 --- a/pkg/filesystem/local/file_test.go +++ b/pkg/filesystem/local/file_test.go @@ -16,7 +16,7 @@ func TestFileStream_GetFileName(t *testing.T) { func TestFileStream_GetMIMEType(t *testing.T) { asserts := assert.New(t) file := FileStream{MIMEType: "123"} - asserts.Equal("123", file.GetFileName()) + asserts.Equal("123", file.GetMIMEType()) } func TestFileStream_GetSize(t *testing.T) { diff --git a/pkg/filesystem/path_test.go b/pkg/filesystem/path_test.go index 81dda09..77571ed 100644 --- a/pkg/filesystem/path_test.go +++ b/pkg/filesystem/path_test.go @@ -408,6 +408,7 @@ func TestFileSystem_Copy(t *testing.T) { } func TestFileSystem_Move(t *testing.T) { + conf.DatabaseConfig.Type = "mysql" asserts := assert.New(t) fs := &FileSystem{User: &model.User{ Model: gorm.Model{ @@ -420,10 +421,7 @@ func TestFileSystem_Move(t *testing.T) { // 目录不存在 { - mock.ExpectQuery("SELECT(.+)").WithArgs(uint(1), "/dst").WillReturnRows( - sqlmock.NewRows([]string{"name"}), - ) - mock.ExpectQuery("SELECT(.+)").WithArgs(uint(1), "/src").WillReturnRows( + mock.ExpectQuery("SELECT(.+)").WillReturnRows( sqlmock.NewRows([]string{"name"}), ) err := fs.Move(ctx, []string{}, []string{}, "/src", "/dst")