Commit 775dd78f authored by Jeromy's avatar Jeromy

test for partner removal

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>
parent 489aeacf
...@@ -89,6 +89,11 @@ func TestPeerIsAddedToPeersWhenMessageReceivedOrSent(t *testing.T) { ...@@ -89,6 +89,11 @@ func TestPeerIsAddedToPeersWhenMessageReceivedOrSent(t *testing.T) {
if !peerIsPartner(sanfrancisco.Peer, seattle.Engine) { if !peerIsPartner(sanfrancisco.Peer, seattle.Engine) {
t.Fatal("Peer wasn't added as a Partner") 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 { func peerIsPartner(p peer.ID, e *Engine) bool {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment