resolve pr comments regarding comments and added a missing newline

This commit is contained in:
Mark Vujevits 2018-11-06 15:20:10 +01:00
parent 23b5b4663a
commit 864ae0f3c2
2 changed files with 11 additions and 0 deletions

View file

@ -254,25 +254,35 @@ func TestSuggestPeerFindPeers(t *testing.T) {
}
// a node should stay in the address book if it's removed from the kademlia
func TestOffEffectingAddressBookNormalNode(t *testing.T) {
k := newTestKademlia("00000000")
// peer added to kademlia
k.On(newTestKadPeer(k, "01000000", false))
// peer should be in the address book
if k.addrs.Size() != 1 {
t.Fatal("known peer addresses should contain 1 entry")
}
// remove peer from kademlia
k.Off(newTestKadPeer(k, "01000000", false))
// peer should not be in the address book
if k.addrs.Size() != 1 {
t.Fatal("known peer addresses should contain 1 entry")
}
}
// a light node should not be in the address book
func TestOffEffectingAddressBookLightNode(t *testing.T) {
k := newTestKademlia("00000000")
// light node peer added to kademlia
k.On(newTestKadPeer(k, "01000000", true))
// peer should not be in the address book
if k.addrs.Size() != 0 {
t.Fatal("known peer addresses should contain 0 entry")
}
// remove peer from kademlia
k.Off(newTestKadPeer(k, "01000000", true))
// peer should not be in the address book
if k.addrs.Size() != 0 {
t.Fatal("known peer addresses should contain 0 entry")
}

View file

@ -306,6 +306,7 @@ func TestRequestFromPeersWithLightNode(t *testing.T) {
t.Fatalf("expected '%v', got %v", expectedError, err)
}
}
func TestStreamerDownstreamChunkDeliveryMsgExchange(t *testing.T) {
tester, streamer, localStore, teardown, err := newStreamerTester(t, &RegistryOptions{
DoServeRetrieve: true,