#NEWLINE# def test_3( self ) : #NEWLINE# #INDENT# '\n        Using multiple keys\n        ' #NEWLINE# from aerospike import predicates as p #NEWLINE# global count #NEWLINE# for i in range ( 2 ) : #NEWLINE# #INDENT# key = ( 'test' , 'unittest' , i ) #NEWLINE# rec = { #NEWLINE# #INDENT# 'name' : ( 'name%s' % str ( i ) ) , #NEWLINE# 'addr' : ( 'name%s' % str ( i ) ) , #NEWLINE# 'age' : query , #NEWLINE# 'no' : i , #NEWLINE# #UNINDENT# } #NEWLINE# self . client . put ( key , rec ) #NEWLINE# #UNINDENT# self . client . index_integer_create ( 'test' , 'unittest' , 'age' , 'age_index' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# query = self . client . query ( 'test' , 'unittest' ) #NEWLINE# query . select ( 'name' , 'age' ) #NEWLINE# count = 0 #NEWLINE# query . where ( p . between ( 'age' , 1 , 3 ) ) #NEWLINE# query . foreach ( count_records_false ) #NEWLINE# self . assertEqual ( count , 1 , 'foreach failed' ) #NEWLINE# for i in range ( 2 ) : #NEWLINE# #INDENT# key = ( 'test' , 'unittest' , i ) #NEWLINE# self . client . remove ( key ) #NEWLINE# #UNINDENT# self . client . index_remove ( 'test' , 'age_index' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } )