EDU-608 Execute "tests.py" action doesn't create Run Study Tests configuration
[idea/community.git] / python / educational-python / course-creator-python / src / com / jetbrains / edu / coursecreator / run / PyCCCommandLineState.java
index 0bde8098b28ff8d094dfc937d92cfe5029e70db0..f4678a97a665e606122b483e5e8fa720f4324d13 100644 (file)
@@ -26,6 +26,8 @@ import com.jetbrains.python.run.CommandLinePatcher;
 import com.jetbrains.python.run.PythonCommandLineState;
 import org.jetbrains.annotations.NotNull;
 
+import java.io.File;
+
 public class PyCCCommandLineState extends PythonCommandLineState {
   private final PyCCRunTestConfiguration myRunConfiguration;
   private final VirtualFile myTaskDir;
@@ -54,7 +56,7 @@ public class PyCCCommandLineState extends PythonCommandLineState {
     assert course != null;
 
     group.addParameter(myRunConfiguration.getPathToTest());
-    group.addParameter(course.getCourseDirectory());
+    group.addParameter(new File(course.getCourseDirectory()).getPath());
 
     group.addParameter(getFirstTaskFilePath());
   }
@@ -62,9 +64,10 @@ public class PyCCCommandLineState extends PythonCommandLineState {
   @NotNull
   private String getFirstTaskFilePath() {
     String firstTaskFileName = StudyUtils.getFirst(myTask.getTaskFiles().keySet());
+    String taskDirPath = FileUtil.toSystemDependentName(myTaskDir.getPath());
     return myTaskDir.findChild(EduNames.SRC) != null ?
-           FileUtil.join(myTaskDir.getPath(), EduNames.SRC, firstTaskFileName) :
-           FileUtil.join(myTaskDir.getPath(), firstTaskFileName);
+           FileUtil.join(taskDirPath, EduNames.SRC, firstTaskFileName) :
+           FileUtil.join(taskDirPath, firstTaskFileName);
   }
 
   @Override