#NEWLINE# def test_overwrite_write( self ) : #NEWLINE# #INDENT# with temporary_dir ( ) as chroot : #NEWLINE# #INDENT# _path = os . path . join ( chroot , 'a/b/c' ) #NEWLINE# safe_mkdir ( _path ) #NEWLINE# data_file = os . path . join ( _path , 'd.txt' ) #NEWLINE# with open ( data_file , 'w' ) as fd : #NEWLINE# #INDENT# fd . write ( 'e' ) #NEWLINE# #UNINDENT# with self . jarfile ( ) as existing_jarfile : #NEWLINE# #INDENT# with self . jar_task . open_jar ( self , overwrite = True ) as jar : #NEWLINE# #INDENT# jar . write ( data_file , 'f/g/h' ) #NEWLINE# #UNINDENT# with open_zip ( existing_jarfile ) as jar : #NEWLINE# #INDENT# self . assert_listing ( jar , 'f/' , 'f/g/' , 'f/g/h' ) #NEWLINE# self . assertEquals ( 'e' , jar . read ( 'f/g/h' ) )