monitor_test.go 753 B

1234567891011121314151617181920212223242526272829303132
  1. package service
  2. import (
  3. "context"
  4. . "github.com/smartystreets/goconvey/convey"
  5. "go-common/app/job/main/videoup-report/model/archive"
  6. "testing"
  7. )
  8. func Test_ArcMonitorStats(t *testing.T) {
  9. Convey("ArcMonitorStats", t, func() {
  10. //var o *archive.Archive
  11. o := &archive.Video{
  12. ID: 10018978,
  13. State: -30,
  14. }
  15. n := &archive.Video{
  16. ID: 10018978,
  17. State: -1,
  18. }
  19. err := s.hdlMonitorVideo(n, o)
  20. So(err, ShouldBeNil)
  21. })
  22. }
  23. func TestMonitorNotify(t *testing.T) {
  24. Convey("MonitorNotify", t, func() {
  25. tpl := s.email.MonitorNotifyTemplate("", "http://uat-manager.bilibili.co/#!/video/list?monitor_list=1_1_5", []string{"liusiming@bilibili.com"})
  26. s.email.PushToRedis(context.TODO(), tpl)
  27. s.email.Start("f_mail_list_fast")
  28. })
  29. }