mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-10 07:42:26 +08:00
cache增加带Context版本,开放平台相关接口支持Context版本 (#653)
This commit is contained in:
10
cache/redis_test.go
vendored
10
cache/redis_test.go
vendored
@@ -4,17 +4,23 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/alicebob/miniredis/v2"
|
||||
)
|
||||
|
||||
func TestRedis(t *testing.T) {
|
||||
server, err := miniredis.Run()
|
||||
if err != nil {
|
||||
t.Error("miniredis.Run Error", err)
|
||||
}
|
||||
t.Cleanup(server.Close)
|
||||
var (
|
||||
timeoutDuration = time.Second
|
||||
ctx = context.Background()
|
||||
opts = &RedisOpts{
|
||||
Host: "127.0.0.1:6379",
|
||||
Host: server.Addr(),
|
||||
}
|
||||
redis = NewRedis(ctx, opts)
|
||||
err error
|
||||
val = "silenceper"
|
||||
key = "username"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user