Skip to content

Commit e18bab3

Browse files
committed
Simple test for GlobalCompletion
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 88a2ca6 commit e18bab3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

bpython/test/test_autocomplete.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,17 @@ def test_completions_starting_with_different_cases(self):
256256
2, ' a', 'class Foo:\n a', ['adsf'],
257257
[Comp('Abc', 'bc'), Comp('ade', 'de')])
258258
self.assertSetEqual(matches, set(['ade']))
259+
260+
261+
class TestGlobalCompletion(unittest.TestCase):
262+
263+
def setUp(self):
264+
self.com = autocomplete.GlobalCompletion()
265+
266+
def test_function(self):
267+
def function():
268+
pass
269+
270+
self.assertEqual(self.com.matches(8, 'function',
271+
locals_={'function': function}),
272+
set(('function(', )))

0 commit comments

Comments
 (0)