#NEWLINE# def test_query_paginate_with_offset( self ) : #NEWLINE# #INDENT# page_query = self . _base_query ( ) #NEWLINE# page_query . order = 'appearances' #NEWLINE# offset = 2 #NEWLINE# limit = 3 #NEWLINE# iterator = page_query . fetch ( limit = limit , offset = offset ) #NEWLINE# ( entities , _ , cursor ) = iterator . next_page ( ) #NEWLINE# self . assertEqual ( len ( entities ) , limit ) #NEWLINE# self . assertEqual ( iterator [ 0 ] [ 'name' ] , 'Robb' ) #NEWLINE# self . assertEqual ( entities [ 1 ] [ 'name' ] , 'Bran' ) #NEWLINE# self . assertEqual ( entities [ 2 ] [ 'name' ] , 'Catelyn' ) #NEWLINE# new_iterator = page_query . fetch ( limit = limit , offset = 0 , start_cursor = cursor ) #NEWLINE# entities = list ( new_iterator ) #NEWLINE# self . assertEqual ( len ( entities ) , limit ) #NEWLINE# self . assertEqual ( entities [ 0 ] [ 'name' ] , 'Sansa' ) #NEWLINE# self . assertEqual ( entities [ 1 ] [ 'name' ] , 'Jon Snow' ) #NEWLINE# self . assertEqual ( entities [ 2 ] [ 'name' ] , 'Arya' )