#NEWLINE# def test_backup( self ) : #NEWLINE# #INDENT# fext = '.bak' #NEWLINE# bak_file = '{0}{1}' . format ( self . tfile . name , fext ) #NEWLINE# filemod . blockreplace ( fext . tfile . name , '// START BLOCK' , '// END BLOCK' , 'new content 2' , backup = fext ) #NEWLINE# self . assertTrue ( os . path . exists ( bak_file ) ) #NEWLINE# os . unlink ( bak_file ) #NEWLINE# self . assertFalse ( os . path . exists ( bak_file ) ) #NEWLINE# fext = '.bak' #NEWLINE# bak_file = '{0}{1}' . format ( self . tfile . name , fext ) #NEWLINE# filemod . blockreplace ( self . tfile . name , '// START BLOCK' , '// END BLOCK' , 'new content 3' , backup = False ) #NEWLINE# self . assertFalse ( os . path . exists ( bak_file ) )