tribler.test_unit.core.socks5.test_client

Classes

MockSocks5Client

A Mocked Socks5Client that does not pull any event loop constructs.

TestSocks5Client

Tests for the Socks5Client class.

Module Contents

class tribler.test_unit.core.socks5.test_client.MockSocks5Client

Bases: tribler.core.socks5.client.Socks5Client

A Mocked Socks5Client that does not pull any event loop constructs.

The following three methods are tested in test_server.

async _login() None

Fake a login.

async _associate_udp(local_addr: tuple[str, int] | None = None) None

Fake a UDP association.

async _connect_tcp(target_addr: tuple[str, int]) None

Fake a TCP connection.

class tribler.test_unit.core.socks5.test_client.TestSocks5Client

Bases: ipv8.test.base.TestBase

Tests for the Socks5Client class.

test_data_received_connected() None

Test if data is fed to the registered callback when a connection is open.

async test_data_received_queue_unconnected() None

Test if data is put in a single-item queue when no connection is open.

test_tcp_connection_lost() None

Test if the tranport is set to None when a TCP connection is lost.

test_udp_connection_lost() None

Test if the tranport is set to None when a UDP connection is lost.

async test_associate_udp() None

Test if a client can associate through UDP.

async test_disallow_associate_udp_on_tcp() None

Test if a client cannot associate through UDP using a pre-established TCP connection.

async test_connect_tcp() None

Test if a client can connect through TCP.

async test_disallow_connect_tcp_on_udp() None

Test if a client cannot connect through TCP using a pre-established UDP association.

async test_send_to() None

Test if we can send over an established UDP connection.

async test_send_to_no_connection() None

Test if we cannot send without an established UDP connection.

async test_write() None

Test if we can write over an established TCP connection.

async test_write_no_connection() None

Test if we cannot write without an established TCP connection.