latest.ipv8.test.REST.test_overlays_endpoint

Module Contents

Classes

MockCommunity2

Empty Community for testing.

TestOverlaysEndpoint

Tests for REST requests to the overlays endpoint.

Functions

hexlify(→ str)

Convert a utf-8 string into a utf-8 hex string.

latest.ipv8.test.REST.test_overlays_endpoint.hexlify(value: str) str

Convert a utf-8 string into a utf-8 hex string.

class latest.ipv8.test.REST.test_overlays_endpoint.MockCommunity2

Bases: latest.ipv8.test.mocking.community.MockCommunity

Empty Community for testing.

community_id = b'DifferentCommunityID'
class latest.ipv8.test.REST.test_overlays_endpoint.TestOverlaysEndpoint

Bases: latest.ipv8.test.REST.rest_base.RESTTestBase

Tests for REST requests to the overlays endpoint.

async setUp() None

Set up a single node.

mount_statistics(i: int, add_mock_community: bool = True) None

Add a statistics endpoint to the given node id and possibly load a mock community.

add_mock_community(i: int, overlay_class: type[latest.ipv8.test.mocking.community.MockCommunity] = MockCommunity) latest.ipv8.test.mocking.community.MockCommunity

Add a given overlay class to the given node id.

async test_no_overlays() None

Check if the overlays endpoint returns no overlays if it has no overlays.

async test_one_overlay_no_peers() None

Check if the overlays endpoint returns one overlay if it has one overlay.

async test_one_overlay_one_peer() None

Check if the overlays endpoint correctly returns its one peer for its one overlay.

async test_one_overlay_multiple_peers() None

Check if the overlays endpoint correctly returns its peers for its one overlay.

async test_one_overlay_statistics() None

Check if the overlays endpoint returns overlay statistics correctly for one overlay.

async test_multiple_overlays() None

Check if the overlays endpoint returns multiple overlays.

async test_statistics_no_overlays() None

Check if no statistics are returned if no overlays are loaded.

async test_statistics_one_overlay() None

Check if statistics are returned for one loaded overlay.

async test_statistics_one_overlay_with_unknown() None

Check if statistics are returned for one loaded overlay, with an unknown message.

async test_enable_stats_not_supported() None

Check if stats cannot be enabled on an endpoint that is not a StatisticsEndpoint.

async test_enable_stats_no_enable_param() None

Check if stats cannot be enabled when the “enable” parameter is missing.

async test_enable_stats_no_target() None

Check if stats cannot be enabled without specifying what overlay(s) to use.

async test_enable_stats_all() None

Check if stats are correctly returned for one “all” overlays.

async test_enable_stats_all_many() None

Check if stats are correctly returned for all overlays.

async test_enable_stats_one_exclude() None

Check if stats are correctly returned for a specific overlay, excluding another.

async test_enable_stats_one_include() None

Check if stats are correctly returned for a specific overlay, including another.