#NEWLINE# @ mock . patch ( ( '%s.spawn' % PATH ) ) #NEWLINE# @ mock . patch ( ( '%s.sp_check_output' % PATH ) ) #NEWLINE# @ mock . patch ( ( '%s.os.path.isfile' % PATH ) , return_value = True ) #NEWLINE# @ mock . patch ( ( '%s.os.environ' % PATH ) ) #NEWLINE# def test_found_correct_python_interpreter_without_distutils( self , mock_environ , mock_isfile , mock_sp_check_output , mock_spawn ) : #NEWLINE# #INDENT# vers = ( 2 , 7 ) #NEWLINE# paths = [ 'one_path' , 'second_path' ] #NEWLINE# mock_environ . get . return_value = ':' . join ( paths ) #NEWLINE# mock_sp_check_output . return_value = ( '%s\n' % str ( vers ) ) #NEWLINE# mock_spawn . find_executable . return_value = None #NEWLINE# found_interpreter = costilius . get_interpreter ( vers ) #NEWLINE# self . assertEqual ( 1 , mock_sp_check_output . call_count ) #NEWLINE# self . assertIn ( found_interpreter , [ ( '%s/%s' % ( f , 'python2.7' ) ) for f in paths ] )