feat(dashboard): unlink file while not deleting its physical source (#789)

This commit is contained in:
Aaron Liu
2023-02-07 20:07:05 +08:00
parent 2a1e82aede
commit 1c1cd9b342
9 changed files with 28 additions and 22 deletions

View File

@@ -3,13 +3,13 @@ package filesystem
import (
"context"
"errors"
"github.com/DATA-DOG/go-sqlmock"
"os"
"testing"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
testMock "github.com/stretchr/testify/mock"
"github.com/DATA-DOG/go-sqlmock"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
@@ -505,7 +505,7 @@ func TestFileSystem_Delete(t *testing.T) {
fs.FileTarget = []model.File{}
fs.DirTarget = []model.Folder{}
err := fs.Delete(ctx, []uint{1}, []uint{1}, true)
err := fs.Delete(ctx, []uint{1}, []uint{1}, true, false)
asserts.NoError(err)
}
//全部成功
@@ -563,7 +563,7 @@ func TestFileSystem_Delete(t *testing.T) {
fs.FileTarget = []model.File{}
fs.DirTarget = []model.Folder{}
err = fs.Delete(ctx, []uint{1}, []uint{1}, false)
err = fs.Delete(ctx, []uint{1}, []uint{1}, false, false)
asserts.NoError(err)
}