Ejemplo n.º 1
0
    def test_create_socket_or_schedule_fail(self):
        """
        Test creation of the UDP socket of the torrent checker when it fails
        """
        def mocked_listen_on_udp():
            raise socket.error("Something went wrong")

        self.torrent_checker.socket_mgr = UdpSocketManager()
        self.torrent_checker.listen_on_udp = mocked_listen_on_udp
        self.torrent_checker.create_socket_or_schedule()

        self.assertIsNone(self.torrent_checker.udp_port)
        self.assertTrue(self.torrent_checker.is_pending_task_active("listen_udp_port"))
Ejemplo n.º 2
0
 def initialize(self):
     self.tracker_check_lc.start(TRACKER_SELECTION_INTERVAL, now=False)
     self.torrent_check_lc.start(TORRENT_SELECTION_INTERVAL, now=False)
     self.connection_pool = HTTPConnectionPool(reactor, False)
     self.socket_mgr = UdpSocketManager()
     self.create_socket_or_schedule()
Ejemplo n.º 3
0
 def initialize(self):
     self._torrent_db = self.tribler_session.open_dbhandler(NTFY_TORRENTS)
     self._reschedule_tracker_select()
     self.connection_pool = HTTPConnectionPool(reactor, False)
     self.socket_mgr = UdpSocketManager()
     self.create_socket_or_schedule()
Ejemplo n.º 4
0
 def initialize(self):
     self._torrent_db = self.tribler_session.open_dbhandler(NTFY_TORRENTS)
     self._reschedule_tracker_select()
     self.socket_mgr = UdpSocketManager()
     self.create_socket_or_schedule()