#NEWLINE# @ override_settings ( API_RESULT_PAGE_SIZE = 20 ) #NEWLINE# def test_image_list_detailed_pagination_less_page_size( self ) : #NEWLINE# #INDENT# filters = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# page_size = settings . API_RESULT_PAGE_SIZE #NEWLINE# limit = getattr ( settings , 'API_RESULT_LIMIT' , 1000 ) #NEWLINE# api_images = self . images . list ( ) #NEWLINE# images_iter = iter ( api_images ) #NEWLINE# glanceclient = self . stub_glanceclient ( ) #NEWLINE# glanceclient . images = self . mox . CreateMockAnything ( ) #NEWLINE# glanceclient . images . list ( limit = limit , page_size = ( page_size + 1 ) , filters = filters , sort_dir = 'desc' , sort_key = 'created_at' ) . AndReturn ( images_iter ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# ( images , has_more , has_prev ) = api . glance . image_list_detailed ( self . request , filters = filters , paginate = True ) #NEWLINE# expected_images = api_images [ : page_size ] #NEWLINE# self . assertItemsEqual ( images , expected_images ) #NEWLINE# self . assertFalse ( has_more ) #NEWLINE# self . assertFalse ( has_prev )