#NEWLINE# def testNamedTemporaryFileNoDelete( self ) : #NEWLINE# #INDENT# obj = self . tempfile . NamedTemporaryFile ( delete = False ) #NEWLINE# obj . write ( b'foo' ) #NEWLINE# obj . close ( ) #NEWLINE# file_obj = self . filesystem . GetObject ( obj . name ) #NEWLINE# if ( sys . version_info >= ( 3 , 0 ) ) : #NEWLINE# #INDENT# contents = file_obj . contents . recover ( False ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# contents = file_obj . contents #NEWLINE# #UNINDENT# self . assertEqual ( 'foo' , contents ) #NEWLINE# obj = self . tempfile . NamedTemporaryFile ( mode = 'w' , delete = False ) #NEWLINE# obj . write ( 'foo' ) #NEWLINE# obj . close ( ) #NEWLINE# file_obj = self . filesystem . GetObject ( obj . name ) #NEWLINE# self . assertEqual ( 'foo' , file_obj . contents )