From a2d66579d7c3aa27459529e057f8b8b851b83246 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 20 Jul 2016 09:27:28 +0200 Subject: [PATCH] Test for the equals that is added to params sometimes. Refs #582. --- test/test_api/test_classes.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/test_api/test_classes.py b/test/test_api/test_classes.py index 69a14744..c3c326fa 100644 --- a/test/test_api/test_classes.py +++ b/test/test_api/test_classes.py @@ -333,3 +333,19 @@ class TestGotoAssignments(TestCase): assert len(ass) == 1 assert ass[0].name == 'json' assert ass[0].type == 'module' + + +def test_added_equals_to_params(): + def run(rest_source): + source = dedent(""" + def foo(bar): + pass + """) + results = Script(source + rest_source).completions() + assert len(results) == 1 + return results[0] + + assert run('foo(bar').name_with_symbols == 'bar=' + assert run('foo(bar').complete == '=' + assert run('foo(bar').name_with_symbols == 'bar' + assert run(' bar').complete == ''