forked from p53841790/wheat-cache
test(client): add storage client
This commit is contained in:
parent
dce8739514
commit
200623bd29
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue