Fix: failed unit tests
This commit is contained in:
parent
5df8f688d1
commit
13fb090194
2 changed files with 3 additions and 5 deletions
|
@ -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) {
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue