3.0.ipv8.test.REST.test_overlays_endpoint ========================================= .. py:module:: 3.0.ipv8.test.REST.test_overlays_endpoint Classes ------- .. autoapisummary:: 3.0.ipv8.test.REST.test_overlays_endpoint.MockCommunity2 3.0.ipv8.test.REST.test_overlays_endpoint.TestOverlaysEndpoint Functions --------- .. autoapisummary:: 3.0.ipv8.test.REST.test_overlays_endpoint.hexlify Module Contents --------------- .. py:function:: hexlify(value: str) -> str Convert a utf-8 string into a utf-8 hex string. .. py:class:: MockCommunity2 Bases: :py:obj:`3.0.ipv8.test.mocking.community.MockCommunity` Empty Community for testing. .. py:attribute:: community_id :value: b'DifferentCommunityID' .. py:class:: TestOverlaysEndpoint Bases: :py:obj:`3.0.ipv8.test.base.TestBase`\ [\ :py:obj:`3.0.ipv8.test.mocking.community.MockCommunity`\ ] Tests for REST requests to the overlays endpoint. .. py:method:: setUp() -> None :async: Set up a single node. .. py:method:: mount_statistics(add_mock_community: bool = True) -> None Add a statistics endpoint to the node and possibly load a mock community. .. py:method:: add_mock_community(overlay_class: type[3.0.ipv8.test.mocking.community.MockCommunity] = MockCommunity) -> 3.0.ipv8.test.mocking.community.MockCommunity Add a given overlay class to the node. .. py:method:: test_no_overlays() -> None :async: Check if the overlays endpoint returns no overlays if it has no overlays. .. py:method:: test_one_overlay_no_peers() -> None :async: Check if the overlays endpoint returns one overlay if it has one overlay. .. py:method:: test_one_overlay_one_peer() -> None :async: Check if the overlays endpoint correctly returns its one peer for its one overlay. .. py:method:: test_one_overlay_multiple_peers() -> None :async: Check if the overlays endpoint correctly returns its peers for its one overlay. .. py:method:: test_one_overlay_statistics() -> None :async: Check if the overlays endpoint returns overlay statistics correctly for one overlay. .. py:method:: test_multiple_overlays() -> None :async: Check if the overlays endpoint returns multiple overlays. .. py:method:: test_statistics_no_overlays() -> None :async: Check if no statistics are returned if no overlays are loaded. .. py:method:: test_statistics_one_overlay() -> None :async: Check if statistics are returned for one loaded overlay. .. py:method:: test_statistics_one_overlay_with_unknown() -> None :async: Check if statistics are returned for one loaded overlay, with an unknown message. .. py:method:: test_enable_stats_not_supported() -> None :async: Check if stats cannot be enabled on an endpoint that is not a StatisticsEndpoint. .. py:method:: test_enable_stats_no_enable_param() -> None :async: Check if stats cannot be enabled when the "enable" parameter is missing. .. py:method:: test_enable_stats_no_target() -> None :async: Check if stats cannot be enabled without specifying what overlay(s) to use. .. py:method:: test_enable_stats_all() -> None :async: Check if stats are correctly returned for one "all" overlays. .. py:method:: test_enable_stats_all_many() -> None :async: Check if stats are correctly returned for all overlays. .. py:method:: test_enable_stats_one_exclude() -> None :async: Check if stats are correctly returned for a specific overlay, excluding another. .. py:method:: test_enable_stats_one_include() -> None :async: Check if stats are correctly returned for a specific overlay, including another.