#NEWLINE# def test_bucket_index_out_of_range( self ) : #NEWLINE# #INDENT# '\n        If the requested id is not within the range of the keyspace then a\n        ValueError should be raised.\n        ' #NEWLINE# parent_node_id = '0xdeadbeef' #NEWLINE# r = RoutingTable ( i ) #NEWLINE# for i in range ( 512 ) : #NEWLINE# #INDENT# contact = PeerNode ( PUBLIC_KEY , ( '192.168.0.%d' % i ) , 9999 , self . version , 0 ) #NEWLINE# contact . network_id = hex ( ( 2 ** i ) ) #NEWLINE# r . add_contact ( contact ) #NEWLINE# #UNINDENT# with self . assertRaises ( ValueError ) : #NEWLINE# #INDENT# r . find_close_nodes ( ( - 1 ) ) #NEWLINE# #UNINDENT# with self . assertRaises ( ValueError ) : #NEWLINE# #INDENT# big_id = ( 2 ** 512 ) #NEWLINE# r . find_close_nodes ( big_id )