Cover part of BiRPCCall in utils/coreutils.go

This commit is contained in:
ionutboangiu
2021-03-09 15:18:44 +02:00
committed by Dan Christian Bogos
parent 4b1cff3bf9
commit d6462f5df4
2 changed files with 33 additions and 1 deletions

View File

@@ -1610,3 +1610,35 @@ func TestMonthlyEstimated(t *testing.T) {
t.Errorf("Expected %+v, received %+v", expectedTime, rcv)
}
}
func TestCoreUtilsBiRPCCallSplitErr(t *testing.T) {
type Server struct{}
var srv Server
var clnt rpcclient.ClientConnector
var args int
var reply *int
serviceMethod := "test.err.call"
expected := rpcclient.ErrUnsupporteServiceMethod
err := BiRPCCall(srv, clnt, serviceMethod, args, reply)
if err == nil || err != expected {
t.Errorf("\nReceived: <%v>, \nExpected: <%v>", err, expected)
}
}
func TestCoreUtilsBiRPCCallMethodNotValid(t *testing.T) {
type Server struct{}
var srv Server
var clnt rpcclient.ClientConnector
var args int
var reply *int
serviceMethod := "test.com"
expected := rpcclient.ErrUnsupporteServiceMethod
err := BiRPCCall(srv, clnt, serviceMethod, args, reply)
if err == nil || err != expected {
t.Errorf("\nReceived: <%v>, \nExpected: <%v>", err, expected)
}
}

View File

@@ -211,7 +211,7 @@ func (ms MapStorage) GetKeys(nested bool, nestedLimit int, prefix string) (keys
prefix += NestingSep
}
if !nested {
// this is a special case for the filter matching were we have the full map:
// this is a special case for the filter matching where we have the full map:
/*
ms:=MapStorage{
"*req":MapStorage{