#NEWLINE# def test_db_query_in( self ) : #NEWLINE# #INDENT# "test db query with '$in','$nin' operators" #NEWLINE# hist = self . client . hub_history ( ) #NEWLINE# even = hist [ : : 2 ] #NEWLINE# odd = hist [ 1 : : 2 ] #NEWLINE# recs = self . client . db_query ( { #NEWLINE# #INDENT# 'msg_id' : { #NEWLINE# #INDENT# '$in' : even , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# found = [ r [ 'msg_id' ] for r in recs ] #NEWLINE# self . assertEquals ( set ( even ) , set ( found ) ) #NEWLINE# recs = self . client . db_query ( { #NEWLINE# #INDENT# 'msg_id' : { #NEWLINE# #INDENT# '$nin' : even , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# found = [ r [ 'msg_id' ] for r in recs ] #NEWLINE# self . assertEquals ( set ( odd ) , set ( found ) )