cosmos-sdk/tests/cli/grpc_query_test.go
Aaron Craelius 4e0a475751
Make client.Context implement gRPC ClientConn (#6342)
* Add QueryConn to client.Context

* Add integration test

* imports

* spelling

* Make client.Context implement grpc ClientConn

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-06-08 13:41:30 +00:00

29 lines
589 B
Go

// +build cli_test
package cli
import (
"context"
"testing"
"github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec/testdata"
)
func TestCliQueryConn(t *testing.T) {
t.Parallel()
f := NewFixtures(t)
// start simd server
proc := f.SDStart()
t.Cleanup(func() { proc.Stop(false) })
ctx := client.NewContext()
testClient := testdata.NewTestServiceClient(ctx)
res, err := testClient.Echo(context.Background(), &testdata.EchoRequest{Message: "hello"})
require.NoError(t, err)
require.Equal(t, "hello", res.Message)
}