latest.ipv8.test.messaging.interfaces.test_statistics_endpoint

Module Contents

Classes

NoSendEndpoint

Endpoint that drops all sent data immediately.

TestStatisticsEndpoint

Tests related to the statistics endpoint.

class latest.ipv8.test.messaging.interfaces.test_statistics_endpoint.NoSendEndpoint

Bases: latest.ipv8.test.mocking.endpoint.AutoMockEndpoint

Endpoint that drops all sent data immediately.

send(socket_address: latest.ipv8.types.Address, packet: bytes) None

When called, this doesn’t do anything.

class latest.ipv8.test.messaging.interfaces.test_statistics_endpoint.TestStatisticsEndpoint(methodName: str = 'runTest')

Bases: latest.ipv8.test.base.TestBase

Tests related to the statistics endpoint.

setUp() None

Create a statistics endpoint that drops all sent data.

async test_getattribute() None

Check if calls to the underlying Endpoint are forwarded.

Note: wan_address is specific to AutoMockEndpoint.

async test_capture_send_enabled() None

Check if send calls are registered when the prefix is enabled.

async test_no_capture_send_disabled() None

Check if send calls are not registered when the prefix is disabled.

async test_capture_receive_enabled() None

Check if receive calls are registered when the prefix is enabled.

async test_no_capture_receive_disabled() None

Check if receive calls are not registered when the prefix is disabled.

async test_get_sent() None

Check if sent messages are correctly logged for an unknown and known prefix.

async test_get_received() None

Check if received messages are correctly logged for an unknown and known prefix.

async test_get_sent_excluded() None

Check if excluded sent messages are not counted.

async test_get_received_excluded() None

Check if excluded received messages are not counted.

async test_aggregate_statistics_sum() None

Check if network stats are correctly summed.

async test_aggregate_statistics_diff_one() None

Check if the time diff is correctly calculated, with one positive stat.

async test_aggregate_statistics_diff_two() None

Check if the time diff is correctly calculated, with two positive stats.

async test_aggregate_statistics_diff_many() None

Check if the time diff is correctly calculated, with four positive stats.