go-common/app/job/main/appstatic/dao/push/redis_test.go

31 lines
556 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package push
import (
"context"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestDao_ZrangeList(t *testing.T) {
Convey("TestDao_ZrangeList", t, WithDao(func(d *Dao) {
data, err := d.ZrangeList(context.TODO())
So(err, ShouldBeNil)
So(data, ShouldNotBeNil)
Printf("%+v", data)
}))
}
func TestDao_ZRem(t *testing.T) {
var (
conn = d.redis.Get(ctx)
key = _pushKey
id = "999"
)
Convey("everything is fine", t, WithDao(func(d *Dao) {
conn.Do("ZADD", key, id)
err := d.ZRem(ctx, id)
So(err, ShouldBeNil)
}))
}