def test_bucket_index_out_of_range(self):
        parent_node_id = '0xdeadbeef'
        r = RoutingTable(parent_node_id)
        # Populate the routing table with contacts.
        for i in range(512):
            contact = PeerNode(PUBLIC_KEY, "192.168.0.%d" % i, 9999,
                               self.version, 0)
            contact.network_id = hex(2 ** i)
            r.add_contact(contact)
        with self.assertRaises(ValueError):
            # Incoming id that's too small.
            r.find_close_nodes(-1)
        with self.assertRaises(ValueError):
            # Incoming id that's too big
            big_id = 2 ** 512
            r.find_close_nodes(big_id)
If the requested id is not within the range of the keyspace then a
dataset/ETHPy150Open ntoll/p4p2p/test/dht/test_routingtable.py/TestRoutingTable.test_bucket_index_out_of_range