Test: share related operation in filesystem

This commit is contained in:
HFO4
2020-02-01 14:26:21 +08:00
parent ab739ea07c
commit 8bb2c2b0c5
10 changed files with 257 additions and 4 deletions

View File

@@ -601,3 +601,16 @@ func TestFileSystem_Preview(t *testing.T) {
asserts.Nil(resp)
}
}
func TestFileSystem_ResetFileIDIfNotExist(t *testing.T) {
asserts := assert.New(t)
ctx := context.WithValue(context.Background(), fsctx.LimitParentCtx, &model.Folder{Model: gorm.Model{ID: 1}})
fs := FileSystem{
FileTarget: []model.File{
{
FolderID: 2,
},
},
}
asserts.Equal(ErrObjectNotExist, fs.resetFileIDIfNotExist(ctx, 1))
}