#NEWLINE# def test_resize( self ) : #NEWLINE# #INDENT# n = 2000 #NEWLINE# idx_name = tempfile . NamedTemporaryFile ( ) #NEWLINE# idx = NSIndex ( ) #NEWLINE# idx . write ( idx_name . name ) #NEWLINE# initial_size = os . path . getsize ( idx_name . name ) #NEWLINE# self . assert_equal ( len ( idx ) , 0 ) #NEWLINE# for x in range ( n ) : #NEWLINE# #INDENT# idx [ bytes ( ( '%-32d' % x ) , 'ascii' ) ] = ( x , x ) #NEWLINE# #UNINDENT# idx . write ( idx_name . name ) #NEWLINE# self . assert_true ( ( initial_size < os . path . getsize ( idx_name . name ) ) ) #NEWLINE# for x in range ( n ) : #NEWLINE# #INDENT# del idx [ bytes ( ( '%-32d' % x ) , 'ascii' ) ] #NEWLINE# #UNINDENT# self . assert_equal ( len ( idx ) , 0 ) #NEWLINE# idx . write ( idx_name . name ) #NEWLINE# self . assert_equal ( initial_size , os . path . getsize ( idx_name . name ) )