From ee6a21f14a08fa003c32a257f1faa6d198c25572 Mon Sep 17 00:00:00 2001 From: Alexander Zolotov Date: Mon, 7 Oct 2013 18:53:04 +0400 Subject: [PATCH] Reimplement select word tests for CSS, CoffeeScript, Ruby, Python, Sass, Scss and Less --- .../jetbrains/python/PySelectWordTest.java | 29 ++----------------- .../jetbrains/python/fixtures/PyTestCase.java | 2 +- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/python/testSrc/com/jetbrains/python/PySelectWordTest.java b/python/testSrc/com/jetbrains/python/PySelectWordTest.java index bf34068dfcab..eac209612102 100644 --- a/python/testSrc/com/jetbrains/python/PySelectWordTest.java +++ b/python/testSrc/com/jetbrains/python/PySelectWordTest.java @@ -1,11 +1,7 @@ package com.jetbrains.python; -import com.intellij.codeInsight.editorActions.SelectWordHandler; -import com.intellij.ide.DataManager; +import com.intellij.testFramework.fixtures.CodeInsightTestUtil; import com.jetbrains.python.fixtures.PyTestCase; -import org.jetbrains.annotations.NonNls; - -import java.io.File; /** * @author yole @@ -36,27 +32,6 @@ public class PySelectWordTest extends PyTestCase { } private void doTest() { - @NonNls final String path = "selectWord/" + getTestName(true); - myFixture.copyDirectoryToProject(path, path); - myFixture.configureByFile(path + "/before.py"); - int i = 1; - while (true) { - @NonNls String resultPath = path + "/after" + i + ".py"; - if (new File(getTestDataPath() + "/" + resultPath).exists()) { - performAction(); - //System.out.println("comparing with "+resultPath); - myFixture.checkResultByFile(resultPath, false); - i++; - } - else { - break; - } - } - assertTrue(i > 1); - } - - private void performAction() { - SelectWordHandler action = new SelectWordHandler(null); - action.execute(myFixture.getEditor(), DataManager.getInstance().getDataContext()); + CodeInsightTestUtil.doWordSelectionTestOnDirectory(myFixture, "selectWord/" + getTestName(true), "py"); } } diff --git a/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java b/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java index 40db6a2ca128..c3d34b34afad 100644 --- a/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java +++ b/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java @@ -36,7 +36,7 @@ import java.io.File; /** * @author yole */ -@TestDataPath("$CONTENT_ROOT/../testData/") +@TestDataPath("$CONTENT_ROOT/../../testData/") public abstract class PyTestCase extends UsefulTestCase { public static String PYTHON_2_MOCK_SDK = "2.7"; public static String PYTHON_3_MOCK_SDK = "3.2";