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

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