test(client): add client

This commit is contained in:
bandl 2021-10-17 20:02:48 +08:00
parent 57e84b6dee
commit 3c68787ff4
1 changed files with 23 additions and 0 deletions

23
client/client_test.go Normal file
View File

@ -0,0 +1,23 @@
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)
}