mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Test: aria2 task monitor 100% cover
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/cluster"
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/mq"
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/task"
|
||||
testMock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
@@ -171,3 +172,15 @@ func (a Aria2Mock) DeleteTempFile(download *model.Download) error {
|
||||
args := a.Called(download)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
type TaskPoolMock struct {
|
||||
testMock.Mock
|
||||
}
|
||||
|
||||
func (t TaskPoolMock) Add(num int) {
|
||||
t.Called(num)
|
||||
}
|
||||
|
||||
func (t TaskPoolMock) Submit(job task.Job) {
|
||||
t.Called(job)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user