Fix the issues with added equals after params in the wrong places. Fixes #643.

This commit is contained in:
Dave Halter
2016-07-20 23:19:05 +02:00
parent a2d66579d7
commit f20df95074
3 changed files with 21 additions and 11 deletions

View File

@@ -338,7 +338,7 @@ class TestGotoAssignments(TestCase):
def test_added_equals_to_params():
def run(rest_source):
source = dedent("""
def foo(bar):
def foo(bar, baz):
pass
""")
results = Script(source + rest_source).completions()
@@ -347,5 +347,8 @@ def test_added_equals_to_params():
assert run('foo(bar').name_with_symbols == 'bar='
assert run('foo(bar').complete == '='
assert run('foo(bar').name_with_symbols == 'bar'
assert run('foo(bar, baz').complete == '='
assert run(' bar').name_with_symbols == 'bar'
assert run(' bar').complete == ''
x = run('foo(bar=isins').name_with_symbols
assert x == 'isinstance'