From 200623bd297c617bc7cf10be14991e066c36ba38 Mon Sep 17 00:00:00 2001 From: bandl <1658002533@qq.com> Date: Thu, 28 Oct 2021 11:59:46 +0800 Subject: [PATCH] test(client): add storage client --- client/client_test.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/client/client_test.go b/client/client_test.go index 04f82bc..7284f4f 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -13,8 +13,10 @@ func TestClient(t *testing.T) { cli, err := NewWheatClient("127.0.0.1:5891", middle.WithUnaryColonyClient) require.NoError(t, err) ctx := context.Background() + bKey := &proto.BaseKey{ Key: "apple", + Ttl: 10, } resp, err := cli.Set(ctx, &proto.SetRequest{ Key: bKey, @@ -29,5 +31,20 @@ func TestClient(t *testing.T) { }) require.NoError(t, err) require.Equal(t, getResp.Result, "yyyy") - +} + +func TestClientGet(t *testing.T) { + cli, err := NewWheatClient("127.0.0.1:5891", middle.WithUnaryColonyClient) + require.NoError(t, err) + ctx := context.Background() + + bKey := &proto.BaseKey{ + Key: "apple", + } + + getResp, err := cli.Get(ctx, &proto.GetRequest{ + Key: bKey, + }) + require.NoError(t, err) + require.Equal(t, getResp.Result, "yyyy") }