latest.ipv8.test.messaging.interfaces.udp.test_endpoint

Module Contents

Classes

DummyEndpointListener

This class simply listens on an endpoint and stores incoming packets in a list.

TestUDPEndpoint

This class contains various tests for the UDP endpoint.

class latest.ipv8.test.messaging.interfaces.udp.test_endpoint.DummyEndpointListener(endpoint: latest.ipv8.messaging.interfaces.udp.endpoint.UDPEndpoint)

Bases: latest.ipv8.messaging.interfaces.endpoint.EndpointListener

This class simply listens on an endpoint and stores incoming packets in a list.

on_packet(packet: tuple[latest.ipv8.types.Address, bytes]) None

Store incoming packets without doing anything with them.

class latest.ipv8.test.messaging.interfaces.udp.test_endpoint.TestUDPEndpoint(methodName: str = 'runTest')

Bases: latest.ipv8.test.base.TestBase

This class contains various tests for the UDP endpoint.

async setUp() None

Create two endpoints that listen on localhost.

async tearDown() None

If an endpoint was used, close it.

async test_send_message() None

Test sending a basic message through the UDP endpoint.

async test_send_many_messages() None

Test sending multiple messages through the UDP endpoint.

async test_send_too_big_message() None

Test sending a too big message through the UDP endpoint.

test_send_invalid_destination() None

Test sending a message with an invalid destination through the UDP endpoint.