mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +08:00
tests for call signature param names
This commit is contained in:
@@ -158,3 +158,16 @@ class TestCallSignatures(TestCase):
|
|||||||
assert len(signatures) == 1
|
assert len(signatures) == 1
|
||||||
x = [p.get_code() for p in signatures[0].params]
|
x = [p.get_code() for p in signatures[0].params]
|
||||||
assert x == ['*args\n']
|
assert x == ['*args\n']
|
||||||
|
|
||||||
|
|
||||||
|
class TestParams(TestCase):
|
||||||
|
def params(self, source, line=None, column=None):
|
||||||
|
signatures = Script(source, line, column).call_signatures()
|
||||||
|
assert len(signatures) == 1
|
||||||
|
return signatures[0].params
|
||||||
|
|
||||||
|
def test_param_name(self):
|
||||||
|
p = self.params('''int(''')
|
||||||
|
# int is defined as: `int(x[, base])`
|
||||||
|
assert p[0].name == 'x'
|
||||||
|
assert p[1].name == 'base'
|
||||||
|
|||||||
Reference in New Issue
Block a user