true, "my_custom_value");
variableManager.addVariables(new IValueVariable[] { myCustomVariable });
try {
IInterpreterManager manager = PydevPlugin.getPythonInterpreterManager(true);
InterpreterInfo info = (InterpreterInfo) manager.getDefaultInterpreterInfo(false);
info.setEnvVariables(new String[] { "MY_CUSTOM_VAR_FOR_TEST=FOO", "MY_CUSTOM_VAR_FOR_TEST2=FOO2",
"MY_CUSTOM_VAR_WITH_VAR=${pydev_python_runner_config_test_var}" });
// Make sure variable hasn't been expanded too early
assertTrue(arrayContains(info.getEnvVariables(),
"MY_CUSTOM_VAR_WITH_VAR=${pydev_python_runner_config_test_var}"));
PythonRunnerConfig runnerConfig = createConfig();
assertTrue(arrayContains(runnerConfig.envp, "MY_CUSTOM_VAR_FOR_TEST=FOO"));
assertTrue(arrayContains(runnerConfig.envp, "MY_CUSTOM_VAR_FOR_TEST2=FOO2"));
assertTrue(arrayContains(runnerConfig.envp, "MY_CUSTOM_VAR_WITH_VAR=my_custom_value"));
String[] argv = runnerConfig.getCommandLine(false);
assertFalse(arrayContains(argv, PythonRunnerConfig.getRunFilesScript()));
assertTrue(arrayContains(argv, mod1.getLocation().toOSString()));
nature.setVersion(IPythonNature.PYTHON_VERSION_LATEST, IPythonNature.DEFAULT_INTERPRETER);
assertEquals(manager.getDefaultInterpreterInfo(false).getExecutableOrJar(), nature.getProjectInterpreter()
.getExecutableOrJar());
runnerConfig = createConfig();
argv = runnerConfig.getCommandLine(false);
assertEquals(manager.getDefaultInterpreterInfo(false).getExecutableOrJar(), argv[0]);
IInterpreterManager interpreterManager = nature.getRelatedInterpreterManager();
InterpreterInfo info2 = new InterpreterInfo(IPythonNature.PYTHON_VERSION_2_6, "c:\\interpreter\\py25.exe",
new ArrayList<String>());
interpreterManager.setInfos(new IInterpreterInfo[] { info, info2 }, null, null);
nature.setVersion(IPythonNature.PYTHON_VERSION_LATEST, "c:\\interpreter\\py25.exe");
assertEquals("c:\\interpreter\\py25.exe", nature.getProjectInterpreter().getExecutableOrJar());