Skip to content

Commit

Permalink
test: add test for UpdateLastSent to peerset_test
Browse files Browse the repository at this point in the history
  • Loading branch information
amirvalhalla committed Jul 3, 2023
1 parent 50d65e9 commit afcfd8a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sync/peerset/peer_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ func TestPeerSet(t *testing.T) {
assert.Equal(t, peer1.Status, StatusCodeBanned)
})

t.Run("Testing UpdateLastSent", func(t *testing.T) {
now := time.Now()
peerSet.UpdateLastSent(pid1)

peer1 := peerSet.getPeer(pid1)
assert.GreaterOrEqual(t, peer1.LastSent, now)
})

t.Run("Testing UpdateLastReceived", func(t *testing.T) {
now := time.Now()
peerSet.UpdateLastReceived(pid1)
Expand Down

0 comments on commit afcfd8a

Please sign in to comment.