tribler.test_integration.test_anon_download

Attributes

DOWNLOADER

RELAY

EXIT

Classes

GlobalTestSettings

Keep track of a global node identifier.

MockDownloadManager

Mocked manager that always allows shutdown (regardless of the libtorrent state).

TestAnonymousDownload

An integration test for anonymous downloads.

Functions

start_http_server(→ aiohttp.web.AppRunner)

Start an HTTP server using the given port and response.

Module Contents

tribler.test_integration.test_anon_download.DOWNLOADER = 0
tribler.test_integration.test_anon_download.RELAY = 1
tribler.test_integration.test_anon_download.EXIT = 2
class tribler.test_integration.test_anon_download.GlobalTestSettings

Bases: ipv8.community.CommunitySettings

Keep track of a global node identifier.

node_id: int = 0
class tribler.test_integration.test_anon_download.MockDownloadManager

Bases: tribler.core.libtorrent.download_manager.download_manager.DownloadManager

Mocked manager that always allows shutdown (regardless of the libtorrent state).

is_shutdown_ready() bool

Always ready.

async tribler.test_integration.test_anon_download.start_http_server(port: int, response: str) aiohttp.web.AppRunner

Start an HTTP server using the given port and response.

class tribler.test_integration.test_anon_download.TestAnonymousDownload

Bases: ipv8.test.base.TestBase[tribler.core.tunnel.community.TriblerTunnelCommunity]

An integration test for anonymous downloads.

MAX_TEST_TIME = 30
setUp() None

Create the necessary tunnel communities.

async tearDown() None

Tear down all communities and the download managers.

create_node(settings: ipv8.community.CommunitySettings | None = None, create_dht: bool = False, enable_statistics: bool = False) ipv8.test.mocking.ipv8.MockIPv8

Create a downloader, relay, or exit node.

The seeder does not have an overlay!

async start_socks_servers() None

Start the socks servers.

async add_mock_download_config(manager: tribler.core.libtorrent.download_manager.download_manager.DownloadManager, hops: int) tribler.core.libtorrent.download_manager.download_config.DownloadConfig

Create a mocked DownloadConfig.

async start_seeding() bytes

Create a file and start the seeding.

async start_anon_download(infohash: bytes) tribler.core.libtorrent.download_manager.download.Download

Start an anonymous download in the main Tribler session.

start_rust() None

Add Rust endpoints to all IPv8 nodes. Should be called after the event loop has started.

async test_anon_download() None

Test a plain anonymous download with an exit node.

async test_http_request() None

Test an anonymous HTTP request.

async test_http_request_split() None

Test an anonymous HTTP request when the response is large enough to require sending multiple packets.