mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
added tests for PyUtil.addElementToStatementList
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
__author__ = 'ktisha'
|
||||
class <caret>A(object):
|
||||
""" class docstring"""
|
||||
def foo(self):
|
||||
self.b = 1
|
||||
@@ -0,0 +1,9 @@
|
||||
__author__ = 'ktisha'
|
||||
class <caret>A(object):
|
||||
""" class docstring"""
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def foo(self):
|
||||
self.b = 1
|
||||
@@ -0,0 +1,5 @@
|
||||
class A:
|
||||
pass
|
||||
|
||||
a = A()
|
||||
a.<caret><warning descr="Unresolved attribute reference 'y' for class 'A'">y</warning>()
|
||||
@@ -0,0 +1,6 @@
|
||||
class A:
|
||||
def y(self):
|
||||
pass
|
||||
|
||||
a = A()
|
||||
a.y()
|
||||
@@ -13,6 +13,14 @@ public class AddMethodQuickFixTest extends PyQuickFixTestCase {
|
||||
doInspectionTest(PyClassHasNoInitInspection.class, PyBundle.message("QFIX.NAME.add.method.$0.to.class.$1", "__init__", "A"));
|
||||
}
|
||||
|
||||
public void testAddInitAfterDocstring() {
|
||||
doInspectionTest(PyClassHasNoInitInspection.class, PyBundle.message("QFIX.NAME.add.method.$0.to.class.$1", "__init__", "A"));
|
||||
}
|
||||
|
||||
public void testAddMethodReplacePass() {
|
||||
doInspectionTest(PyUnresolvedReferencesInspection.class, PyBundle.message("QFIX.NAME.add.method.$0.to.class.$1", "y", "A"));
|
||||
}
|
||||
|
||||
public void testAddMethodFromInstance() {
|
||||
doInspectionTest(PyUnresolvedReferencesInspection.class, PyBundle.message("QFIX.NAME.add.method.$0.to.class.$1", "y", "A"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user