#NEWLINE# def test_readwrite( self ) : #NEWLINE# #INDENT# format = Frequency ( None ) #NEWLINE# postings = self . make_postings ( ) #NEWLINE# postfile = self . make_file ( 'readwrite' ) #NEWLINE# try : #NEWLINE# #INDENT# fpw = FilePostingWriter ( postfile , blocklimit = 8 ) #NEWLINE# fpw . start ( format ) #NEWLINE# for ( id , freq ) in postings : #NEWLINE# #INDENT# fpw . write ( id , format . encode ( freq ) ) #NEWLINE# #UNINDENT# fpw . close ( ) #NEWLINE# postfile = self . open_file ( 'readwrite' ) #NEWLINE# fpr = FilePostingReader ( postfile , 0 , format ) #NEWLINE# fpr . close ( ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# self . delete_file ( 'readwrite' )