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