#NEWLINE# def test_list_pagination_reverse_with_empty_page( self ) : #NEWLINE# #INDENT# return_value = [ ] #NEWLINE# instance = self . plugin . return_value #NEWLINE# instance . get_networks . return_value = return_value #NEWLINE# params = { #NEWLINE# #INDENT# 'limit' : [ '2' ] , #NEWLINE# 'marker' : [ str ( _uuid ( ) ) ] , #NEWLINE# 'page_reverse' : [ 'True' ] , #NEWLINE# #UNINDENT# } #NEWLINE# res = self . api . get ( _get_path ( 'networks' ) , params = params ) . json #NEWLINE# self . assertEqual ( [ ] , res [ 'networks' ] ) #NEWLINE# next_links = [ ] #NEWLINE# if ( 'networks_links' in res ) : #NEWLINE# #INDENT# for r in res [ 'networks_links' ] : #NEWLINE# #INDENT# self . assertNotEqual ( r [ 'rel' ] , 'previous' ) #NEWLINE# if ( r [ 'rel' ] == 'next' ) : #NEWLINE# #INDENT# next_links . append ( r ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . assertEqual ( 1 , len ( next_links ) ) #NEWLINE# url = urlparse . urlparse ( next_links [ 0 ] [ 'href' ] ) #NEWLINE# self . assertEqual ( url . path , _get_path ( 'networks' ) ) #NEWLINE# expect_params = params . copy ( ) #NEWLINE# del expect_params [ 'marker' ] #NEWLINE# del expect_params [ 'page_reverse' ] #NEWLINE# self . assertEqual ( expect_params , urlparse . parse_qs ( url . query ) )