From 1684b45610ddd115762da1a154e8577a903f2cfe Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 14 Oct 2021 11:48:30 +0300 Subject: tests: Check if we return an error and not crash if r.Peer is nil Signed-off-by: Donatas Abraitis --- pkg/server/server_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go index 43856bef..24dcdf95 100644 --- a/pkg/server/server_test.go +++ b/pkg/server/server_test.go @@ -71,8 +71,11 @@ func TestStop(t *testing.T) { }, } err = s.AddPeer(context.Background(), &api.AddPeerRequest{Peer: p}) - err = s.AddPeer(context.Background(), &api.AddPeerRequest{}) assert.Nil(err) + + err = s.AddPeer(context.Background(), &api.AddPeerRequest{}) + assert.Error(err) + s.StopBgp(context.Background(), &api.StopBgpRequest{}) } -- cgit v1.2.3