Commit 2cd931cf authored by mdj33's avatar mdj33 Committed by vipwzw

fix ut

parent b94a1abd
......@@ -77,17 +77,27 @@ func TestChannelClient_GetTitleHeight(t *testing.T) {
client := newGrpc(api)
client.Init("paracross", nil, nil, nil)
req := &pt.ReqParacrossTitleHeight{}
api.On("Query", pt.GetExecName(), "GetTitleHeight", req).Return(&pt.RespParacrossDone{}, nil)
api.On("Query", pt.GetExecName(), "GetTitleHeight", req).Return(&pt.ParacrossHeightStatusRsp{}, nil)
_, err := client.GetTitleHeight(context.Background(), req)
assert.Nil(t, err)
}
func TestChannelClient_GetTitleDoneHeight(t *testing.T) {
api := new(mocks.QueueProtocolAPI)
client := newGrpc(api)
client.Init("paracross", nil, nil, nil)
req := &pt.ReqParacrossTitleHeight{}
api.On("Query", pt.GetExecName(), "GetDoneTitleHeight", req).Return(&pt.RespParacrossDone{}, nil)
_, err := client.GetDoneTitleHeight(context.Background(), req)
assert.Nil(t, err)
}
func TestJrpc_GetTitleHeight(t *testing.T) {
api := new(mocks.QueueProtocolAPI)
j := newJrpc(api)
req := &pt.ReqParacrossTitleHeight{}
var result interface{}
api.On("Query", pt.GetExecName(), "GetTitleHeight", req).Return(&pt.RespParacrossDone{}, nil)
api.On("Query", pt.GetExecName(), "GetTitleHeight", req).Return(&pt.ParacrossHeightStatusRsp{}, nil)
err := j.GetTitleHeight(req, &result)
assert.Nil(t, err)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment