Skip to content

Commit

Permalink
test for partner removal
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
  • Loading branch information
whyrusleeping committed May 20, 2017
1 parent f53dc7c commit 331e60b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions exchange/bitswap/decision/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ func TestPeerIsAddedToPeersWhenMessageReceivedOrSent(t *testing.T) {
if !peerIsPartner(sanfrancisco.Peer, seattle.Engine) {
t.Fatal("Peer wasn't added as a Partner")
}

seattle.Engine.PeerDisconnected(sanfrancisco.Peer)
if peerIsPartner(sanfrancisco.Peer, seattle.Engine) {
t.Fatal("expected peer to be removed")
}
}

func peerIsPartner(p peer.ID, e *Engine) bool {
Expand Down

0 comments on commit 331e60b

Please sign in to comment.