MCPcopy Create free account
hub / github.com/CPChain/chain / TestClientRequest

Function TestClientRequest

api/rpc/client_test.go:37–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35)
36
37func TestClientRequest(t *testing.T) {
38 server := newTestServer("service", new(Service))
39 defer server.Stop()
40 client := DialInProc(server)
41 defer client.Close()
42
43 var resp Result
44 if err := client.Call(&resp, "service_echo", "hello", 10, &Args{"world"}); err != nil {
45 t.Fatal(err)
46 }
47 if !reflect.DeepEqual(resp, Result{"hello", 10, &Args{"world"}}) {
48 t.Errorf("incorrect result %#v", resp)
49 }
50}
51
52func TestClientBatchRequest(t *testing.T) {
53 server := newTestServer("service", new(Service))

Callers

nothing calls this directly

Calls 6

newTestServerFunction · 0.85
DialInProcFunction · 0.85
StopMethod · 0.65
CloseMethod · 0.65
CallMethod · 0.65
FatalMethod · 0.65

Tested by

no test coverage detected