redis_test.go 914 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package redis
  2. import (
  3. "context"
  4. "testing"
  5. tmod "go-common/app/job/main/videoup-report/model/task"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func Test_SetVideoJam(t *testing.T) {
  9. Convey("SetVideoJam", t, func() {
  10. _ = d.SetVideoJam(context.TODO(), 1)
  11. })
  12. }
  13. func Test_TrackAddRedis(t *testing.T) {
  14. Convey("TrackAddRedis", t, func() {
  15. err := d.TrackAddRedis(context.TODO(), "", "")
  16. So(err, ShouldNotBeNil)
  17. })
  18. }
  19. func Test_SetWeight(t *testing.T) {
  20. Convey("SetWeight", t, func() {
  21. err := d.SetWeight(context.TODO(), map[int64]*tmod.WeightParams{
  22. 1: &tmod.WeightParams{
  23. TaskID: 1,
  24. Weight: 1,
  25. },
  26. 2: &tmod.WeightParams{
  27. TaskID: 2,
  28. Weight: 2,
  29. },
  30. })
  31. So(err, ShouldBeNil)
  32. })
  33. }
  34. func Test_GetWeight(t *testing.T) {
  35. Convey("GetWeight", t, func() {
  36. mcases, err := d.GetWeight(context.TODO(), []int64{1, 2})
  37. So(err, ShouldBeNil)
  38. So(mcases, ShouldNotBeNil)
  39. })
  40. }