#NEWLINE# def test_zpop_byrank( self ) : #NEWLINE# #INDENT# ( yield self . client . zadd ( 'foo' , 1 , 'a' , 2 , 'b' , 3 , 'c' , 4 , 'd' , 5 , 'e' ) ) #NEWLINE# res = ( yield self . client . zpopbyrank ( 'foo' , 0 ) ) #NEWLINE# rem = ( yield self . client . zrange ( 'foo' , 0 , ( - 1 ) ) ) #NEWLINE# self . assertEqual ( len ( rem ) , 4 ) #NEWLINE# self . assertEqual ( rem , [ b'b' , b'c' , b'd' , b'e' ] ) #NEWLINE# self . assertEqual ( res , [ b'a' ] ) #NEWLINE# res = ( yield self . client . zpopbyrank ( 'foo' , 0 , 2 ) ) #NEWLINE# self . assertEqual ( res , [ b'b' , b'c' , b'd' ] ) #NEWLINE# rem = ( yield self . client . zrange ( 'foo' , 0 , ( - 1 ) ) ) #NEWLINE# self . assertEqual ( rem , [ b'e' ] )