mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Some sother small test improvements
This commit is contained in:
@@ -545,21 +545,22 @@ class Script(object):
|
|||||||
string.
|
string.
|
||||||
:rtype: :class:`refactoring.Refactoring`
|
:rtype: :class:`refactoring.Refactoring`
|
||||||
"""
|
"""
|
||||||
return self._extract_variable(line, column, **kwargs)
|
return self._extract_variable(line, column, **kwargs) # Python 2...
|
||||||
|
|
||||||
def _extract_variable(self, line, column, new_name): # Python 2...
|
def _extract_variable(self, line, column, new_name, until_line=None, until_column=None):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def extract_function(self, line=None, column=None, **kwargs):
|
def extract_function(self, line=None, column=None, **kwargs):
|
||||||
"""
|
"""
|
||||||
"""
|
"""
|
||||||
return self._extract_method(line, column, **kwargs)
|
return self._extract_method(line, column, **kwargs) # Python 2...
|
||||||
|
|
||||||
def _extract_function(self, line, column, new_name): # Python 2...
|
def _extract_function(self, line, column, new_name, until_line=None, until_column=None):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def inline_variable(self, line=None, column=None, until_line=None, until_column=None):
|
def inline(self, line=None, column=None):
|
||||||
"""
|
"""
|
||||||
|
Inlines a variable under the cursor.
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ def test():
|
|||||||
|
|
||||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
def test():
|
def test():
|
||||||
|
#? 35 {'new_name': 'a'}
|
||||||
a = (30 + b, c) + 1
|
a = (30 + b, c) + 1
|
||||||
return test(100, a)
|
return test(100, a)
|
||||||
|
|
||||||
@@ -16,6 +17,7 @@ def test():
|
|||||||
|
|
||||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
def test():
|
def test():
|
||||||
|
#? 25 {'new_name': 'a'}
|
||||||
a = 30 + b
|
a = 30 + b
|
||||||
return test(100, (a, c) + 1)
|
return test(100, (a, c) + 1)
|
||||||
|
|
||||||
@@ -27,6 +29,7 @@ def test():
|
|||||||
+ 1)
|
+ 1)
|
||||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
def test():
|
def test():
|
||||||
|
#? 30 {'new_name': 'a'}
|
||||||
x = ((30 + b, c)
|
x = ((30 + b, c)
|
||||||
+ 1)
|
+ 1)
|
||||||
return test(1, x
|
return test(1, x
|
||||||
@@ -40,6 +43,7 @@ def test():
|
|||||||
+ 1)
|
+ 1)
|
||||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
def test():
|
def test():
|
||||||
|
#? 25 {'new_name': 'a'}
|
||||||
x = 30 + b
|
x = 30 + b
|
||||||
return test(1, (x, c)
|
return test(1, (x, c)
|
||||||
+ 1)
|
+ 1)
|
||||||
@@ -1,18 +1,20 @@
|
|||||||
# -------------------------------------------------- simple
|
# -------------------------------------------------- simple-1
|
||||||
def test():
|
def test():
|
||||||
#? 4
|
#? 4
|
||||||
a = (30 + b, c) + 1
|
a = (30 + b, c) + 1
|
||||||
return test(100, a)
|
return test(100, a)
|
||||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
def test():
|
def test():
|
||||||
|
#? 4
|
||||||
return test(100, (30 + b, c) + 1)
|
return test(100, (30 + b, c) + 1)
|
||||||
|
|
||||||
|
|
||||||
# -------------------------------------------------- simple
|
# -------------------------------------------------- simple-2
|
||||||
if 1:
|
if 1:
|
||||||
#? 4
|
#? 4
|
||||||
a = 1, 2
|
a = 1, 2
|
||||||
return test(100, a)
|
return test(100, a)
|
||||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
if 1:
|
if 1:
|
||||||
|
#? 4
|
||||||
return test(100, (1, 2))
|
return test(100, (1, 2))
|
||||||
|
|||||||
Reference in New Issue
Block a user