mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-02-23 15:54:30 +00:00
rpc/server: prevent test panicing in checkErrGetResult()
If we expect some resp.Error, then check for it explicitly.
This commit is contained in:
parent
b04c8623c5
commit
fd72f0635e
1 changed files with 1 additions and 0 deletions
|
@ -1091,6 +1091,7 @@ func checkErrGetResult(t *testing.T, body []byte, expectingFail bool) json.RawMe
|
||||||
err := json.Unmarshal(body, &resp)
|
err := json.Unmarshal(body, &resp)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
if expectingFail {
|
if expectingFail {
|
||||||
|
require.NotNil(t, resp.Error)
|
||||||
assert.NotEqual(t, 0, resp.Error.Code)
|
assert.NotEqual(t, 0, resp.Error.Code)
|
||||||
assert.NotEqual(t, "", resp.Error.Message)
|
assert.NotEqual(t, "", resp.Error.Message)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue