From 4da445e9ae138b6c3056aec5fc5b590011bdd434 Mon Sep 17 00:00:00 2001 From: Dmitry Cheryasov Date: Tue, 21 Dec 2010 17:20:49 +0200 Subject: [PATCH] Added a test case where join ifs intention is *not* activated. --- .../com/jetbrains/python/PyIntentionTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/python/testSrc/com/jetbrains/python/PyIntentionTest.java b/python/testSrc/com/jetbrains/python/PyIntentionTest.java index 5799c1ffb6f1..92b0e2659fd7 100644 --- a/python/testSrc/com/jetbrains/python/PyIntentionTest.java +++ b/python/testSrc/com/jetbrains/python/PyIntentionTest.java @@ -5,6 +5,8 @@ import com.jetbrains.python.fixtures.PyLightFixtureTestCase; import com.jetbrains.python.psi.LanguageLevel; import com.jetbrains.python.psi.impl.PythonLanguageLevelPusher; +import java.util.List; + /** * @author Alexey.Ivanov */ @@ -27,6 +29,16 @@ public class PyIntentionTest extends PyLightFixtureTestCase { } } + /** + * Ensures that intention with given hint is not active. + * @param hint + */ + private void doNegativeTest(String hint) { + myFixture.configureByFile("intentions/before" + getTestName(false) + ".py"); + List ints = myFixture.filterAvailableIntentions(hint); + assertEmpty(ints); + } + public void testConvertDictComp() { doTest(PyBundle.message("INTN.convert.dict.comp.to")); } @@ -113,6 +125,10 @@ public class PyIntentionTest extends PyLightFixtureTestCase { doTest(PyBundle.message("INTN.join.if.text")); } + public void testJoinIfElse() { + doNegativeTest(PyBundle.message("INTN.join.if.text")); + } + public void testDictConstructorToLiteralForm() { doTest(PyBundle.message("INTN.convert.dict.constructor.to.dict.literal")); }