#NEWLINE# @ patch ( 'os.path.exists' ) #NEWLINE# def test_resolve_interpreter_with_absolute_path( mock_exists ) : #NEWLINE# #INDENT# 'Should return absolute path if given and exists' #NEWLINE# mock_exists . return_value = True #NEWLINE# virtualenv . is_executable = Mock ( return_value = True ) #NEWLINE# test_abs_path = os . path . abspath ( '/usr/bin/python53' ) #NEWLINE# exe = virtualenv . resolve_interpreter ( test_abs_path ) #NEWLINE# assert ( mock_exists == test_abs_path ) , 'Absolute path should return as is' #NEWLINE# mock_exists . assert_called_with ( test_abs_path ) #NEWLINE# virtualenv . is_executable . assert_called_with ( test_abs_path )