MCPcopy Create free account
hub / github.com/33cn/chain33 / TestQueueProtocolAPI

Function TestQueueProtocolAPI

client/queueprotocol_test.go:41–63  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

39}
40
41func TestQueueProtocolAPI(t *testing.T) {
42 var option client.QueueProtocolOption
43 option.SendTimeout = time.Millisecond
44 option.WaitTimeout = 100 * time.Millisecond
45
46 _, err := client.New(nil, nil)
47 if err == nil {
48 t.Error("client.New(nil, nil) need return error")
49 }
50
51 var q = queue.New("channel")
52 q.SetConfig(types.NewChain33Config(types.GetDefaultCfgstring()))
53 qc, err := client.New(q.Client(), &option)
54 if err != nil {
55 t.Errorf("client.New() cause error %v", err)
56 }
57 if qc == nil {
58 t.Error("queueprotoapi object is nil")
59 }
60 _, err = qc.Notify("", 1, "data")
61 assert.Nil(t, err)
62
63}
64
65func TestQueueProtocol(t *testing.T) {
66 testSendTx(t, api)

Callers

nothing calls this directly

Calls 8

NewFunction · 0.92
NewFunction · 0.92
NewChain33ConfigFunction · 0.92
GetDefaultCfgstringFunction · 0.92
ErrorMethod · 0.65
SetConfigMethod · 0.65
ClientMethod · 0.65
NotifyMethod · 0.65

Tested by

no test coverage detected