redis_test.go 706 B

1234567891011121314151617181920212223242526272829303132
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/job/main/figure/model"
  5. "testing"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. var (
  9. testRedisMid int64 = 15555180
  10. )
  11. func Test_PingRedis(t *testing.T) {
  12. Convey("ping redis", t, WithDao(func(d *Dao) {
  13. So(d.PingRedis(context.TODO()), ShouldBeNil)
  14. }))
  15. }
  16. func Test_SetWaiteUserCache(t *testing.T) {
  17. Convey("set waite user cache", t, WithDao(func(d *Dao) {
  18. So(d.SetWaiteUserCache(context.TODO(), testRedisMid, 111), ShouldBeNil)
  19. }))
  20. }
  21. func Test_AddFigureInfoCache(t *testing.T) {
  22. Convey("add figure info cache", t, WithDao(func(d *Dao) {
  23. f := &model.Figure{Mid: testRedisMid}
  24. So(d.AddFigureInfoCache(context.TODO(), f), ShouldBeNil)
  25. }))
  26. }