tests: replace t.Fatal with require where possible

This makes tests less verbose and unifies the style
they are written in.
This commit is contained in:
Evgenii Stratonikov 2020-02-29 18:55:16 +03:00
parent 66f96e3f32
commit a3dacd3b74
14 changed files with 52 additions and 120 deletions

View file

@ -29,9 +29,7 @@ func TestSendVersion(t *testing.T) {
assert.Equal(t, uint32(0), version.StartHeight)
}
if err := p.SendVersion(); err != nil {
t.Fatal(err)
}
require.NoError(t, p.SendVersion())
}
// Server should reply with a verack after receiving a valid version.
@ -49,9 +47,7 @@ func TestVerackAfterHandleVersionCmd(t *testing.T) {
}
version := payload.NewVersion(1337, 3000, "/NEO-GO/", 0, true)
if err := s.handleVersionCmd(p, version); err != nil {
t.Fatal(err)
}
require.NoError(t, s.handleVersionCmd(p, version))
}
// Server should not reply with a verack after receiving a