#NEWLINE# def test_limit( self ) : #NEWLINE# #INDENT# ' It can limit the total amount of results. ' #NEWLINE# base = self . query . metrics ( 'pageviews' ) . range ( '2014-07-01' , '2014-07-05' ) . interval ( 'day' ) #NEWLINE# full_report = base . get ( ) #NEWLINE# limited_report = base . limit ( 2 ) . get ( ) #NEWLINE# self . assertEqual ( len ( limited_report . rows ) , 2 ) #NEWLINE# self . assertEqual ( len ( limited_report ) , 2 ) #NEWLINE# self . assertEqual ( full_report [ 'pageviews' ] [ : 2 ] , limited_report [ 'pageviews' ] )