mysql_schedule_task_test.go 640 B

123456789101112131415161718192021222324252627282930313233
  1. package dao
  2. import (
  3. "strconv"
  4. "testing"
  5. "time"
  6. "go-common/app/admin/ep/marthe/model"
  7. . "github.com/smartystreets/goconvey/convey"
  8. )
  9. var (
  10. tmpIssueNoStr3 = strconv.FormatInt(time.Now().Unix(), 10)
  11. scheduleTask = &model.ScheduleTask{
  12. Name: tmpIssueNoStr3,
  13. Status: model.TaskStatusRunning,
  14. }
  15. )
  16. func Test_Schedule_task(t *testing.T) {
  17. Convey("test insert schedule task", t, func() {
  18. err := d.InsertScheduleTask(scheduleTask)
  19. So(err, ShouldBeNil)
  20. })
  21. Convey("test update schedule task", t, func() {
  22. scheduleTask.Status = model.TaskStatusDone
  23. err := d.UpdateScheduleTask(scheduleTask)
  24. So(err, ShouldBeNil)
  25. })
  26. }