Test: pkg modifications

This commit is contained in:
HFO4
2020-02-17 14:17:06 +08:00
parent 0502a0f212
commit 663b827a1d
3 changed files with 52 additions and 0 deletions

View File

@@ -8,6 +8,28 @@ import (
"time"
)
func TestBuildShareList(t *testing.T) {
asserts := assert.New(t)
timeNow := time.Now()
shares := []model.Share{
{
Expires: &timeNow,
File: model.File{
Model: gorm.Model{ID: 1},
},
},
{
Folder: model.Folder{
Model: gorm.Model{ID: 1},
},
},
}
res := BuildShareList(shares, 2)
asserts.Equal(0, res.Code)
}
func TestBuildShareResponse(t *testing.T) {
asserts := assert.New(t)