#NEWLINE# def test_paging_query_with_max( self ) : #NEWLINE# #INDENT# self . docs = self . rand_docs . get_docs ( 1000 ) #NEWLINE# with gzip . open ( 'temp_file.json.gz' , 'wb' ) as f : #NEWLINE# #INDENT# f . write ( json . dumps ( self . docs ) . encode ( 'utf-8' ) ) #NEWLINE# #UNINDENT# r = self . solr . stream_file ( test_config [ 'SOLR_COLLECTION' ] , 'temp_file.json.gz' ) #NEWLINE# self . commit ( ) #NEWLINE# queries = 0 #NEWLINE# docs = [ ] #NEWLINE# for res in self . solr . paging_query ( test_config [ 'SOLR_COLLECTION' ] , { #NEWLINE# #INDENT# 'q' : '*:*' , #NEWLINE# #UNINDENT# } , rows = 50 , max_start = 502 ) : #NEWLINE# #INDENT# self . assertTrue ( ( len ( res . docs ) == 50 ) ) #NEWLINE# queries += 1 #NEWLINE# docs . extend ( res . docs ) #NEWLINE# #UNINDENT# ids = [ x [ 'id' ] for x in docs ] #NEWLINE# for item in docs : #NEWLINE# #INDENT# self . assertTrue ( ( queries [ 'id' ] in ids ) ) #NEWLINE# #UNINDENT# self . assertEqual ( 11 , queries ) #NEWLINE# self . delete_docs ( ) #NEWLINE# self . commit ( ) #NEWLINE# try : #NEWLINE# #INDENT# os . remove ( 'temp_file.json.gz' ) #NEWLINE# os . remove ( 'temp_file.json' ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass