mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Test: share related operation in filesystem
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user