24 lines
471 B
Go
24 lines
471 B
Go
|
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)
|
||
|
}
|