forked from VimPlug/jedi
little refactoring
This commit is contained in:
+5
-3
@@ -520,14 +520,16 @@ def check_flow_information(flow, search_name, pos):
|
|||||||
def check_statement_information(stmt, search_name):
|
def check_statement_information(stmt, search_name):
|
||||||
try:
|
try:
|
||||||
ass = stmt.get_assignment_calls()
|
ass = stmt.get_assignment_calls()
|
||||||
assert len(ass.values) == 1 and len(ass.values[0]) == 1
|
try:
|
||||||
call = ass.values[0][0]
|
call = ass.get_only_subelement()
|
||||||
|
except AttributeError:
|
||||||
|
assert False
|
||||||
assert type(call) == parsing.Call and str(call.name) == 'isinstance'
|
assert type(call) == parsing.Call and str(call.name) == 'isinstance'
|
||||||
assert bool(call.execution)
|
assert bool(call.execution)
|
||||||
|
|
||||||
# isinstance check
|
# isinstance check
|
||||||
isinst = call.execution.values
|
isinst = call.execution.values
|
||||||
assert len(isinst) == 2
|
assert len(isinst) == 2 # has two params
|
||||||
assert len(isinst[0]) == 1
|
assert len(isinst[0]) == 1
|
||||||
assert len(isinst[1]) == 1
|
assert len(isinst[1]) == 1
|
||||||
assert isinstance(isinst[0][0], parsing.Call)
|
assert isinstance(isinst[0][0], parsing.Call)
|
||||||
|
|||||||
Reference in New Issue
Block a user