3.0.ipv8.test.messaging.interfaces.dispatcher.test_endpoint
Classes
Module Contents
- class 3.0.ipv8.test.messaging.interfaces.dispatcher.test_endpoint.DummyEndpointListener(endpoint: 3.0.ipv8.messaging.interfaces.endpoint.Endpoint)
Bases:
3.0.ipv8.messaging.interfaces.endpoint.EndpointListenerThis class simply listens on an endpoint and stores incoming packets in a list.
- incoming = []
- class 3.0.ipv8.test.messaging.interfaces.dispatcher.test_endpoint.DummyEndpoint
Bases:
3.0.ipv8.messaging.interfaces.endpoint.EndpointNon-functional endpoint for manual staging and inspection.
- opened = False
- sent = []
- bytes_up = 0
- bytes_down = 0
- get_address() 3.0.ipv8.types.Address
Give a fake localhost IPv4 address.
- class 3.0.ipv8.test.messaging.interfaces.dispatcher.test_endpoint.TestDispatcherEndpoint(methodName: str = 'runTest')
Bases:
3.0.ipv8.test.base.TestBaseThis class contains various tests for the DispatcherEndpoint.
- RANDOM_DATA = b'data'
- static _produce_dummy() tuple[3.0.ipv8.messaging.interfaces.dispatcher.endpoint.DispatcherEndpoint, DummyEndpoint, DummyEndpointListener]
- Async:
Create and open a DispatcherEndpoint, dispatching to a dummy endpoint and listener.
- async test_initialize_no_interfaces() None
Check if the DispatcherEndpoint can initialize and “send” without interfaces.
This is black-hole functionality and should not crash (though we can’t really assert anything here).
- async test_dispatch_receive() None
Check if packet reception is correctly propagated from children.
- async test_dispatch_send_specific() None
Check if packet sending is correctly propagated to children, with specific interface.
- async test_get_address_specific() None
Check if get_address is correctly propagated from children, with specific interface.
- async test_add_prefix_listener() None
Check if add_prefix_listener is correctly propagated to children.
- async test_guess_interface_ipv6_short() None
Check if guess_interface guesses shortened IPv6 interfaces correctly.
- async test_guess_interface_ipv6_very_short() None
Check if guess_interface guesses zero-omitted IPv6 interfaces correctly.