forked from TrueCloudLab/neoneo-go
rpc/client: add tests for Ping
This commit is contained in:
parent
48f1502167
commit
316666cc22
1 changed files with 13 additions and 0 deletions
|
@ -156,3 +156,16 @@ func TestSignAndPushInvocationTx(t *testing.T) {
|
|||
require.Equal(t, h, tx.Hash())
|
||||
require.EqualValues(t, 30, tx.SystemFee)
|
||||
}
|
||||
|
||||
func TestPing(t *testing.T) {
|
||||
chain, rpcSrv, httpSrv := initServerWithInMemoryChain(t)
|
||||
defer chain.Close()
|
||||
|
||||
c, err := client.New(context.Background(), httpSrv.URL, client.Options{Network: testchain.Network()})
|
||||
require.NoError(t, err)
|
||||
|
||||
require.NoError(t, c.Ping())
|
||||
require.NoError(t, rpcSrv.Shutdown())
|
||||
httpSrv.Close()
|
||||
require.Error(t, c.Ping())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue