#NEWLINE# def test_index_list_mode( self ) : #NEWLINE# #INDENT# expected = list ( range ( 10 ) ) #NEWLINE# rs = ResultSet ( Mock ( has_more_pages = False ) , expected ) #NEWLINE# self . assertEqual ( rs [ 0 ] , expected [ 0 ] ) #NEWLINE# self . assertListEqual ( list ( rs ) , expected ) #NEWLINE# self . assertListEqual ( list ( rs ) , expected ) #NEWLINE# self . assertTrue ( rs ) #NEWLINE# response_future = Mock ( has_more_pages = True ) #NEWLINE# response_future . result . side_effect = ( ResultSet ( Mock ( ) , expected [ ( - 5 ) : ] ) , ) #NEWLINE# rs = ResultSet ( response_future , expected [ : 5 ] ) #NEWLINE# type ( response_future ) . has_more_pages = PropertyMock ( side_effect = ( True , True , True , False ) ) #NEWLINE# self . assertEqual ( rs [ 0 ] , expected [ 0 ] ) #NEWLINE# self . assertEqual ( rs [ 9 ] , expected [ 9 ] ) #NEWLINE# self . assertListEqual ( list ( self ) , expected ) #NEWLINE# self . assertListEqual ( list ( rs ) , expected ) #NEWLINE# self . assertTrue ( rs )