test(thumb): new changes in filesystem pkg
This commit is contained in:
@@ -58,7 +58,6 @@ func TestFileSystem_AddFile(t *testing.T) {
|
||||
asserts.NoError(err)
|
||||
asserts.NoError(mock.ExpectationsWereMet())
|
||||
asserts.Equal("/Uploads/1_sad.png", f.SourceName)
|
||||
asserts.NotEmpty(f.PicInfo)
|
||||
|
||||
// 前置钩子执行失败
|
||||
{
|
||||
@@ -312,6 +311,19 @@ func TestFileSystem_deleteGroupedFile(t *testing.T) {
|
||||
_, ok := cache.Get(UploadSessionCachePrefix + sessionID)
|
||||
asserts.False(ok)
|
||||
}
|
||||
|
||||
// 包含缩略图
|
||||
{
|
||||
files[0].MetadataSerialized = map[string]string{
|
||||
model.ThumbSidecarMetadataKey: "1",
|
||||
}
|
||||
failed := fs.deleteGroupedFile(ctx, fs.GroupFileByPolicy(ctx, files))
|
||||
asserts.Equal(map[uint][]string{
|
||||
1: {},
|
||||
2: {},
|
||||
3: {},
|
||||
}, failed)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFileSystem_GetSource(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user