mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
[python] Improve test coverage of ImportToImportFromIntention
GitOrigin-RevId: 5c98b2124a35b66132b007c2c60236df90b5adff
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5c3ab09590
commit
0b75360e40
10
python/testData/intentions/removeQualifierFromThisName.py
Normal file
10
python/testData/intentions/removeQualifierFromThisName.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import builtins as b
|
||||
|
||||
quotient, rem = b.divmod(42, 3)
|
||||
b.divmod
|
||||
|
||||
class MyClass(object):
|
||||
@b.stati<caret>cmethod
|
||||
@b.staticmethod
|
||||
def method():
|
||||
pass
|
||||
@@ -0,0 +1,11 @@
|
||||
import builtins as b
|
||||
from builtins import staticmethod
|
||||
|
||||
quotient, rem = b.divmod(42, 3)
|
||||
b.divmod
|
||||
|
||||
class MyClass(object):
|
||||
@staticmethod
|
||||
@staticmethod
|
||||
def method():
|
||||
pass
|
||||
@@ -6,6 +6,8 @@ import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.openapi.ui.TestDialogManager;
|
||||
import com.intellij.openapi.ui.TestInputDialog;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.ui.ChooserInterceptor;
|
||||
import com.intellij.ui.UiInterceptors;
|
||||
import com.jetbrains.python.PyPsiBundle;
|
||||
import com.jetbrains.python.codeInsight.PyCodeInsightSettings;
|
||||
import com.jetbrains.python.documentation.PyDocumentationSettings;
|
||||
@@ -464,10 +466,21 @@ public class PyIntentionTest extends PyTestCase {
|
||||
}
|
||||
|
||||
// PY-45863
|
||||
public void testImportAsToImportFromAll() {
|
||||
public void testRemoveQualifierFromAllUsages() {
|
||||
shouldSelectRemoveQualifierOption(0);
|
||||
doTest("Remove 'b' qualifier");
|
||||
}
|
||||
|
||||
public void testRemoveQualifierFromThisName() {
|
||||
shouldSelectRemoveQualifierOption(1);
|
||||
doTest("Remove 'b' qualifier");
|
||||
}
|
||||
|
||||
private static void shouldSelectRemoveQualifierOption(int index) {
|
||||
List<String> options = List.of("Remove qualifier from all usages", "Remove qualifier from this name");
|
||||
UiInterceptors.register(new ChooserInterceptor(options, options.get(index)));
|
||||
}
|
||||
|
||||
// PY-45863
|
||||
public void testImportFQNToImportFromAll() {
|
||||
doMultiFileTest("Remove 'pkg.mod' qualifier");
|
||||
|
||||
Reference in New Issue
Block a user