tribler.test_integration.test_hidden_services ============================================= .. py:module:: tribler.test_integration.test_hidden_services Attributes ---------- .. autoapisummary:: tribler.test_integration.test_hidden_services.DOWNLOADER tribler.test_integration.test_hidden_services.SEEDER tribler.test_integration.test_hidden_services.RELAYS tribler.test_integration.test_hidden_services.EXITS Classes ------- .. autoapisummary:: tribler.test_integration.test_hidden_services.GlobalTestSettings tribler.test_integration.test_hidden_services.MockDownloadManager tribler.test_integration.test_hidden_services.MockExitDict tribler.test_integration.test_hidden_services.TestHiddenServicesDownload Module Contents --------------- .. py:data:: DOWNLOADER :value: 0 .. py:data:: SEEDER :value: 1 .. py:data:: RELAYS :value: [2, 3, 4] .. py:data:: EXITS :value: [5, 6] .. 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:class:: MockExitDict Bases: :py:obj:`dict` Wrap all exit sockets in a mock. .. py:method:: __getitem__(key: int) -> ipv8.test.mocking.exit_socket.MockTunnelExitSocket Get the exit socket belonging to a given circuit id. .. py:class:: TestHiddenServicesDownload 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: 90 .. 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_hidden_services() -> None :async: Test an e2e anonymous download.