mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Test: Task list / file delete
This commit is contained in:
@@ -2,6 +2,7 @@ package thumb
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/HFO4/cloudreve/pkg/cache"
|
||||
"github.com/HFO4/cloudreve/pkg/util"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"image"
|
||||
@@ -99,3 +100,22 @@ func TestThumb_Save(t *testing.T) {
|
||||
asserts.True(util.Exists("TestThumb_Save.png"))
|
||||
|
||||
}
|
||||
|
||||
func TestThumb_CreateAvatar(t *testing.T) {
|
||||
asserts := assert.New(t)
|
||||
file := CreateTestImage()
|
||||
defer file.Close()
|
||||
|
||||
thumb, err := NewThumbFromFile(file, "123.jpg")
|
||||
asserts.NoError(err)
|
||||
|
||||
cache.Set("setting_avatar_path", "tests", 0)
|
||||
cache.Set("setting_avatar_size_s", "50", 0)
|
||||
cache.Set("setting_avatar_size_m", "130", 0)
|
||||
cache.Set("setting_avatar_size_l", "200", 0)
|
||||
|
||||
asserts.NoError(thumb.CreateAvatar(1))
|
||||
asserts.True(util.Exists("tests/avatar_1_1.png"))
|
||||
asserts.True(util.Exists("tests/avatar_1_2.png"))
|
||||
asserts.True(util.Exists("tests/avatar_1_0.png"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user