#NEWLINE# def test_symlink_to_bin( self ) : #NEWLINE# #INDENT# ' symlink to bin should symlink to the bin sprinter environment folder ' #NEWLINE# ( _ , temp_file_path ) = tempfile . mkstemp ( ) #NEWLINE# try : #NEWLINE# #INDENT# with open ( temp_file_path , 'w+' ) as temp_file : #NEWLINE# #INDENT# temp_file . write ( 'hobo' ) #NEWLINE# #UNINDENT# self . directory . symlink_to_bin ( 'newfile' , temp_file_path ) #NEWLINE# assert os . path . islink ( os . path . join ( self . directory . bin_path ( ) , 'newfile' ) ) #NEWLINE# tools . eq_ ( open ( os . path . join ( self . directory . bin_path ( ) , 'newfile' ) ) . read ( ) , open ( temp_file_path ) . read ( ) , 'File contents are different for symlinked files!' ) #NEWLINE# assert os . access ( os . path . join ( self . directory . bin_path ( ) , 'newfile' ) , os . X_OK ) , 'File is not executable!' #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# os . unlink ( temp_file_path )