test(client): update client test

This commit is contained in:
bandl 2021-10-19 13:04:45 +08:00
parent 6ef4654c63
commit e94a41ec73
1 changed files with 14 additions and 4 deletions

View File

@ -13,11 +13,21 @@ 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",
},
bKey := &proto.BaseKey{
Key: "apple",
}
resp, err := cli.Set(ctx, &proto.SetRequest{
Key: bKey,
Val: "yyyy",
})
require.NoError(t, err)
require.Equal(t, resp.Result, "yyyy")
getResp, err := cli.Get(ctx, &proto.GetRequest{
Key: bKey,
})
require.NoError(t, err)
require.Equal(t, getResp.Result, "yyyy")
}