1
0
forked from VimPlug/jedi

instances are basically working now, tests are not -> satisfy tests!

This commit is contained in:
David Halter
2012-05-01 04:59:40 +02:00
parent 0d083782ab
commit c0d9cbf0b6
7 changed files with 195 additions and 66 deletions

View File

@@ -34,8 +34,12 @@ b2.upper
# list assignment
[list1, list2] = (1, "")
#? []
list1.index
#? ['real']
list1.real
#? []
list1.lower
#? ['lower']
list2.lower
#? []

View File

@@ -1,9 +1,15 @@
class TestClass(object):
var_class = TestClass()
var_class = TestClass(1)
def __init__(self2, a):
self2.var_inst = a
def __init__(self2, first_param, second_param):
self2.var_inst = first_aparam
self2.second = second_param
def get_var_inst(self):
# traversal
self.second_new = self.second
return self.var_inst
def values(self):
self.var_local = 3
@@ -19,7 +25,24 @@ inst = TestClass(1)
inst.var
#? ['var_class']
TestClass.var_class
TestClass.var
#? ['real']
inst.var_local.real
#? []
TestClass.var_local.real
#? ['real']
TestClass().ret(1).real
#? ['real']
inst.ret(1).real
myclass = TestClass(1, '')
#? ['real']
TestClass(1).var_inst.
#? ['real']
myclass.get_var_inst().real
#? []
myclass.get_var_inst().upper
#? []
myclass.get_var_inst.real

View File

@@ -2,6 +2,8 @@ def openbrace():
asdf = 3
asdf
asdf(
#? ['real']
asdf.real
return 1
#? ['real']
@@ -11,3 +13,17 @@ blub([
#? ['real']
openbrace().real
def indentfault():
asd(
indentback
#? []
indentfault().
def openbrace2():
asd(
def normalfunc():
return 1
#? ['real']
normalfunc().real

View File

@@ -60,13 +60,14 @@ def completion_test(source):
completion_test_dir = 'completion'
summary = []
for f_name in os.listdir(completion_test_dir):
if f_name.endswith(".py"):
path = os.path.join(completion_test_dir, f_name)
f = open(path)
num_tests, fails = completion_test(f.read())
s = 'run %s tests with %s fails (%s)' % (num_tests, fails, f_name)
print s
summary.append(s)
if len(sys.argv) == 1 or [a for a in sys.argv[1:] if a in f_name]:
if f_name.endswith(".py"):
path = os.path.join(completion_test_dir, f_name)
f = open(path)
num_tests, fails = completion_test(f.read())
s = 'run %s tests with %s fails (%s)' % (num_tests, fails, f_name)
print s
summary.append(s)
print '\nSummary:'
for s in summary: