tribler.test_integration.test_anon_download =========================================== .. py:module:: tribler.test_integration.test_anon_download Attributes ---------- .. autoapisummary:: tribler.test_integration.test_anon_download.DOWNLOADER tribler.test_integration.test_anon_download.RELAY tribler.test_integration.test_anon_download.EXIT Classes ------- .. autoapisummary:: tribler.test_integration.test_anon_download.GlobalTestSettings tribler.test_integration.test_anon_download.MockDownloadManager tribler.test_integration.test_anon_download.TestAnonymousDownload Functions --------- .. autoapisummary:: tribler.test_integration.test_anon_download.start_http_server Module Contents --------------- .. py:data:: DOWNLOADER :value: 0 .. py:data:: RELAY :value: 1 .. py:data:: EXIT :value: 2 .. py:class:: GlobalTestSettings Bases: :py:obj:`ipv8.community.CommunitySettings` Keep track of a global node identifier. .. py:attribute:: node_id :type: int :value: 0 .. py:class:: MockDownloadManager Bases: :py:obj:`tribler.core.libtorrent.download_manager.download_manager.DownloadManager` Mocked manager that always allows shutdown (regardless of the libtorrent state). .. py:method:: is_shutdown_ready() -> bool Always ready. .. py:function:: start_http_server(port: int, response: str) -> aiohttp.web.AppRunner :async: Start an HTTP server using the given port and response. .. py:class:: TestAnonymousDownload Bases: :py:obj:`ipv8.test.base.TestBase`\ [\ :py:obj:`tribler.core.tunnel.community.TriblerTunnelCommunity`\ ] An integration test for anonymous downloads. .. py:attribute:: MAX_TEST_TIME :value: 30 .. py:method:: setUp() -> None Create the necessary tunnel communities. .. py:method:: tearDown() -> None :async: Tear down all communities and the download managers. .. py:method:: 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! .. py:method:: start_socks_servers() -> None :async: Start the socks servers. .. py:method:: add_mock_download_config(manager: tribler.core.libtorrent.download_manager.download_manager.DownloadManager, hops: int) -> tribler.core.libtorrent.download_manager.download_config.DownloadConfig :async: Create a mocked DownloadConfig. .. py:method:: start_seeding() -> bytes :async: Create a file and start the seeding. .. py:method:: start_anon_download(infohash: bytes) -> tribler.core.libtorrent.download_manager.download.Download :async: Start an anonymous download in the main Tribler session. .. py:method:: start_rust() -> None Add Rust endpoints to all IPv8 nodes. Should be called after the event loop has started. .. py:method:: test_anon_download() -> None :async: Test a plain anonymous download with an exit node. .. py:method:: test_http_request() -> None :async: Test an anonymous HTTP request. .. py:method:: test_http_request_split() -> None :async: Test an anonymous HTTP request when the response is large enough to require sending multiple packets.