wheat-cache/client/client_test.go

24 lines
471 B
Go
Raw Normal View History

2021-10-17 20:02:48 +08:00
package client
import (
"context"
"testing"
"gitee.com/timedb/wheatCache/client/middle"
"gitee.com/timedb/wheatCache/pkg/proto"
"github.com/stretchr/testify/require"
)
func TestClient(t *testing.T) {
cli, err := NewWheatClient("127.0.0.1:5891", middle.WithUnaryColonyClient)
require.NoError(t, err)
ctx := context.Background()
_, err = cli.Set(ctx, &proto.SetRequest{
Key: &proto.BaseKey{
Key: "apple",
},
Val: "yyyy",
})
require.NoError(t, err)
}