mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-10 05:52:22 +08:00
added import tests
This commit is contained in:
@@ -1,4 +1,22 @@
|
||||
# -----------------
|
||||
# std lib modules
|
||||
# -----------------
|
||||
import tokenize
|
||||
#? ['tok_name']
|
||||
tokenize.tok_name
|
||||
|
||||
from pyclbr import *
|
||||
|
||||
#? ['readmodule_ex']
|
||||
readmodule_ex
|
||||
import os
|
||||
|
||||
#? ['dirname']
|
||||
os.path.dirname
|
||||
|
||||
# -----------------
|
||||
# builtins
|
||||
# -----------------
|
||||
|
||||
import sys
|
||||
#? ['prefix']
|
||||
@@ -7,14 +25,13 @@ sys.prefix
|
||||
#? ['append']
|
||||
sys.path.append
|
||||
|
||||
|
||||
# --- builtin math ---
|
||||
|
||||
from math import *
|
||||
#? ['cos', 'cosh']
|
||||
cos
|
||||
|
||||
import os
|
||||
def func_with_import():
|
||||
import time
|
||||
return time
|
||||
|
||||
#? ['dirname']
|
||||
os.path.dirname
|
||||
#? ['sleep']
|
||||
func_with_import().sleep
|
||||
|
||||
@@ -39,11 +39,12 @@ def completion_test(source):
|
||||
print traceback.format_exc()
|
||||
fails += 1
|
||||
else:
|
||||
# TODO remove sorted? completions should be sorted
|
||||
# TODO remove sorted? completions should be sorted?
|
||||
comp_str = str(sorted([str(c) for c in completions]))
|
||||
if comp_str != correct:
|
||||
print 'Solution not correct, received %s, wanted %s' % \
|
||||
(comp_str, correct)
|
||||
#print [(c.name, c.name.parent) for c in completions]
|
||||
fails += 1
|
||||
correct = None
|
||||
tests += 1
|
||||
|
||||
Reference in New Issue
Block a user