From e94a41ec735642481e32e4dbff2d477814f51f05 Mon Sep 17 00:00:00 2001 From: bandl <1658002533@qq.com> Date: Tue, 19 Oct 2021 13:04:45 +0800 Subject: [PATCH] test(client): update client test --- client/client_test.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/client/client_test.go b/client/client_test.go index a317a40..04f82bc 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -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") + }