Exemplo n.º 1
0
 def setup(self):
     self.got_peers = None
     querier_ = querier.QuerierMock(tc.CLIENT_ID)
     routing_m = RoutingManagerMock()
     self.bootstrap_nodes = routing_m.get_closest_rnodes(tc.INFO_HASH_ZERO)
     self.lm = lookup_manager.LookupManager(tc.CLIENT_ID, querier_,
                                            routing_m, 2)
     self.lookup = self.lm.get_peers(tc.INFO_HASH, self._on_got_peers,
                                     tc.BT_PORT)
Exemplo n.º 2
0
 def setup(self):
     self.got_peers = None
     querier_ = querier.QuerierMock(tc.CLIENT_ID)
     routing_m = RoutingManagerMock()
     self.bootstrap_nodes = routing_m.get_closest_rnodes(
         tc.INFO_HASH_ZERO)
     self.lm = lookup_manager.LookupManager(tc.CLIENT_ID,
                                            querier_,
                                            routing_m,
                                            2)
     self.lookup = self.lm.get_peers(tc.INFO_HASH, self._on_got_peers,
                                tc.BT_PORT)
Exemplo n.º 3
0
 def setup(self):
     self.got_peers = None
     querier_ = querier.QuerierMock(tc.CLIENT_ID)
     bootstrap_nodes = RoutingManagerMock().get_closest_rnodes(
         tc.INFO_HASH_ZERO)
     self.lookup = lookup_manager.GetPeersLookup(tc.CLIENT_ID, querier_, 2,
                                                 tc.INFO_HASH_ZERO,
                                                 self._callback,
                                                 bootstrap_nodes)
Exemplo n.º 4
0
 def test_routing_m_mock(self):
     # Just testing interface
     rm = RoutingManagerMock()
     eq_(rm.get_closest_rnodes(tc.TARGET_ID), tc.NODES)
Exemplo n.º 5
0
 def test_routing_m_mock(self):
     # Just testing interface
     rm = RoutingManagerMock()
     eq_(rm.get_closest_rnodes(tc.TARGET_ID), tc.NODES)