feat: seeding status for aria2 download tasks (#1422)
* feat: add aria2 seeding * fix: move RecycleTaskType to the bottom * refactor: refactor recycle aria2 temp file
This commit is contained in:
@@ -2,12 +2,12 @@ package task
|
||||
|
||||
import (
|
||||
"errors"
|
||||
testMock "github.com/stretchr/testify/mock"
|
||||
"testing"
|
||||
|
||||
"github.com/DATA-DOG/go-sqlmock"
|
||||
model "github.com/cloudreve/Cloudreve/v3/models"
|
||||
"github.com/stretchr/testify/assert"
|
||||
testMock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
func TestRecord(t *testing.T) {
|
||||
@@ -103,4 +103,16 @@ func TestGetJobFromModel(t *testing.T) {
|
||||
asserts.Nil(job)
|
||||
asserts.Error(err)
|
||||
}
|
||||
// RecycleTaskType
|
||||
{
|
||||
task := &model.Task{
|
||||
Status: 0,
|
||||
Type: RecycleTaskType,
|
||||
}
|
||||
mock.ExpectQuery("SELECT(.+)users(.+)").WillReturnError(errors.New("error"))
|
||||
job, err := GetJobFromModel(task)
|
||||
asserts.NoError(mock.ExpectationsWereMet())
|
||||
asserts.Nil(job)
|
||||
asserts.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user