tests for task file actions
[idea/community.git] / python / educational-core / course-creator / testSrc / com / jetbrains / edu / coursecreator / CCTestCase.java
index 4cfa08c913281660c8d0d6805e0e49f48dadc59d..8a16347581ff13483f7cc3d0ad1c77b8f77849d6 100644 (file)
@@ -106,13 +106,16 @@ public abstract class CCTestCase extends CodeInsightFixtureTestCase {
     });
   }
 
+  protected VirtualFile copyFileToTask(String name) {
+    return myFixture.copyFileToProject(name, FileUtil.join(getProject().getBasePath(), "lesson1", "task1", name));
+  }
+
   protected VirtualFile configureByTaskFile(String name) {
     Task task = StudyTaskManager.getInstance(getProject()).getCourse().getLessons().get(0).getTaskList().get(0);
     TaskFile taskFile = new TaskFile();
     taskFile.setTask(task);
     task.getTaskFiles().put(name, taskFile);
-    VirtualFile file =
-      myFixture.copyFileToProject(name, FileUtil.join(getProject().getBasePath(), "lesson1", "task1", name));
+    VirtualFile file = copyFileToTask(name);
     myFixture.configureFromExistingVirtualFile(file);
     Document document = FileDocumentManager.getInstance().getDocument(file);
     for (AnswerPlaceholder placeholder : getPlaceholders(document, false)) {