latest.ipv8.test.test_peer

Module Contents

Classes

TestPeer

Tests related to the peer class.

class latest.ipv8.test.test_peer.TestPeer(methodName: str = 'runTest')

Bases: latest.ipv8.test.base.TestBase

Tests related to the peer class.

test_key
setUp() None

Set up a peer to test with.

test_default_timestamp() None

Check if the default Lamport timestamp of a Peer is 0.

test_increment_timestamp() None

Check if the Lamport timestamp of a Peer can be incremented.

test_increase_timestamp() None

Check if the Lamport timestamp of a Peer can be increased arbitrarily.

test_decrease_timestamp() None

Check if the Lamport timestamp of a Peer cannot be decreased.

test_peer_equality() None

Check if peers with the same key and address are equal.

test_peer_inequality_key() None

Check if peers with a different key and same address are not equal.

test_median_ping_none() None

No ping measurements should lead to a None median ping.

test_avg_ping_none() None

No ping measurements should lead to a None average ping.

test_median_ping_odd() None

Median ping should return the median ping for odd length measurements.

test_median_ping_even() None

Median ping should return the median ping for even length measurements.

test_avg_ping() None

Average ping should return the average ping.

test_peer_inequality_address() None

Check if peers with the same key and a different address are equal.

test_to_string() None

Check if the __str__ method functions properly.

test_set_address_init() None

Check if the address property properly sets from the init.

test_set_address_setter() None

Check if the address property properly sets from the setter.

test_set_address_add() None

Check if the address property properly sets from add_address.

test_set_address_addv6() None

Check if IPv6 addresses are properly returned.

test_address_order1() None

Check if IPv6 is preferred over IPv4 (append out-of-order).

test_address_order2() None

Check if IPv6 is preferred over IPv4 (append in-order).

test_default_address() None

Check if the default address is UDPv4Address(“0.0.0.0”, 0).

test_manual_update() None

Check if manual updates to the addresses dictionary are caught.

test_manual_updates() None

Check if manual updates to the addresses dictionary are caught (double update, out-of-order).

test_manual_update_overwrite() None

Check if manual updates to the addresses dictionary are caught (overwrite same class).