Files
cloudreve/pkg/serializer/slave_test.go
XYenon b1685d2863 feat: seeding status for aria2 download tasks (#1422)
* feat: add aria2 seeding

* fix: move RecycleTaskType to the bottom

* refactor: refactor recycle aria2 temp file
2022-09-29 09:24:58 +08:00

33 lines
574 B
Go

package serializer
import (
"testing"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/stretchr/testify/assert"
)
func TestSlaveTransferReq_Hash(t *testing.T) {
a := assert.New(t)
s1 := &SlaveTransferReq{
Src: "1",
Policy: &model.Policy{},
}
s2 := &SlaveTransferReq{
Src: "2",
Policy: &model.Policy{},
}
a.NotEqual(s1.Hash("1"), s2.Hash("1"))
}
func TestSlaveRecycleReq_Hash(t *testing.T) {
a := assert.New(t)
s1 := &SlaveRecycleReq{
Path: "1",
}
s2 := &SlaveRecycleReq{
Path: "2",
}
a.NotEqual(s1.Hash("1"), s2.Hash("1"))
}