You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
733 B
36 lines
733 B
package dao |
|
|
|
import ( |
|
"testing" |
|
"time" |
|
|
|
"go-common/app/admin/ep/merlin/model" |
|
|
|
. "github.com/smartystreets/goconvey/convey" |
|
) |
|
|
|
var ( |
|
testMachine = model.Machine{ |
|
EndTime: time.Now().Add((-1) * time.Hour), |
|
ID: 123123, |
|
} |
|
) |
|
|
|
func Test_Task(t *testing.T) { |
|
Convey("test InsertDeleteMachinesTasks", t, func() { |
|
err := d.InsertDeleteMachinesTasks([]*model.Machine{&testMachine}) |
|
So(err, ShouldBeNil) |
|
}) |
|
|
|
Convey("test FindDeleteMachineTasks", t, func() { |
|
tasks, err := d.FindDeleteMachineTasks() |
|
So(err, ShouldBeNil) |
|
So(len(tasks), ShouldBeGreaterThan, 0) |
|
}) |
|
|
|
Convey("test UpdateTaskStatusByMachines", t, func() { |
|
err := d.UpdateTaskStatusByMachines([]int64{testMachine.ID}, 2) |
|
So(err, ShouldBeNil) |
|
}) |
|
|
|
}
|
|
|