Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

src/d/h/DHTBot-HEAD/dhtbot/test/kademlia/test_routing_table.py   DHTBot(Download)
        for node_id in [2, 4, 8, 2**158, 2**159]:
            rt.offer_node(generate_node(node_id))
        closest_nodes = rt.get_closest_nodes(target, 2)
        self.assertEquals(map(extract_id, closest_nodes), [2**159, 2**158])
 
        # 1 node close to our node id
        rt.offer_node(generate_node(5))
        closest_nodes = rt.get_closest_nodes(target)
        expectedIDs = node_id_sequence(2**150, 2**157, 2)
        expectedIDs.append(5)
        for ID in rand_list:
            rt.offer_node(generate_node(ID))
        closest_nodes = rt.get_closest_nodes(target)
        self.assertEquals(expectedIDs, map(extract_id, closest_nodes))