summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-10-14 11:48:30 +0300
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2021-10-15 06:47:46 +0900
commit1684b45610ddd115762da1a154e8577a903f2cfe (patch)
treebabf7460abe6076ee82c55d382e091c1cbdfaa27
parenta40bc53502bbc6646c85842c07e2c6288e3b27ae (diff)
tests: Check if we return an error and not crash if r.Peer is nil
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
-rw-r--r--pkg/server/server_test.go5
1 files changed, 4 insertions, 1 deletions
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{})
}