Skip to content

Fix 506 #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e3dfb4f
Add Ctrl-e to complete current suggestion.
amjith Mar 13, 2015
577b9c7
use configurable keys for right arrow completion
thomasballinger Mar 13, 2015
d2287ad
Merge branch 'ctrl-e'
thomasballinger Mar 13, 2015
e83fb4a
Change default to None and set it to LOCK_EX in __init__ (fixes #509)
sebastinas Mar 15, 2015
4d26621
Move attr_{matches,lookup} to AttrCompleter
sebastinas Mar 15, 2015
5cf6f52
Makes old style classes and instances show __dict__ in the autocomplete.
Mar 15, 2015
cb90872
Adds tests to validate that __dict__ is in the autocomplete of an old
Mar 15, 2015
a82b4b5
Makes the old-style class autocomplete work in 2.6 and 3.x
Mar 15, 2015
2cfa83b
Re-introduce autocompletion modes
sebastinas Mar 16, 2015
c830c75
Update tests
sebastinas Mar 16, 2015
27b9493
Fix fuzzy completion test
sebastinas Mar 16, 2015
ad8958f
Merge remote-tracking branch 'llllllllll/old-style-class-dict-autocom…
sebastinas Mar 16, 2015
ac630cc
Move pasting logic out of Repl
sebastinas Mar 23, 2015
5cdfa51
Update translations
sebastinas Mar 23, 2015
21b9a54
Use bpython.config's getpreferredencoding
sebastinas Mar 24, 2015
38f1ed6
Remember the source of interactively defined functions
michaelmulley Mar 25, 2015
7ca380d
Move linecache code to new file, use super()
michaelmulley Mar 25, 2015
92e9b0b
No need to catch this AttributeError in test code
michaelmulley Mar 25, 2015
80765a8
Fix bpdb name
sebastinas Apr 20, 2015
bb1389a
Add Keywords
sebastinas Apr 20, 2015
a33048d
fixed bug #506
thekthuser Apr 26, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update tests
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
  • Loading branch information
sebastinas committed Mar 16, 2015
commit c830c7502c34b5e9f568df10c501ecd02f3d6fb4
6 changes: 3 additions & 3 deletions bpython/test/test_curtsies_repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def setUp(self):
def test_list_win_visible_match_selected_on_tab_multiple_options(self):
self.repl._current_line = " './'"
self.repl._cursor_offset = 2
with mock.patch('bpython.autocomplete.get_completer_bpython') as m:
with mock.patch('bpython.autocomplete.get_completer') as m:
m.return_value = (['./abc', './abcd', './bcd'],
autocomplete.FilenameCompletion())
self.repl.update_completion()
Expand All @@ -191,7 +191,7 @@ def test_list_win_visible_match_selected_on_tab_multiple_options(self):
def test_list_win_not_visible_and_cseq_if_cseq(self):
self.repl._current_line = " './a'"
self.repl._cursor_offset = 5
with mock.patch('bpython.autocomplete.get_completer_bpython') as m:
with mock.patch('bpython.autocomplete.get_completer') as m:
m.return_value = (['./abcd', './abce'],
autocomplete.FilenameCompletion())
self.repl.update_completion()
Expand All @@ -204,7 +204,7 @@ def test_list_win_not_visible_and_cseq_if_cseq(self):
def test_list_win_not_visible_and_match_selected_if_one_option(self):
self.repl._current_line = " './a'"
self.repl._cursor_offset = 5
with mock.patch('bpython.autocomplete.get_completer_bpython') as m:
with mock.patch('bpython.autocomplete.get_completer') as m:
m.return_value = (['./abcd'], autocomplete.FilenameCompletion())
self.repl.update_completion()
self.assertEqual(self.repl.list_win_visible, False)
Expand Down
20 changes: 8 additions & 12 deletions bpython/test/test_repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,24 +316,22 @@ def test_simple_global_complete(self):
['def', 'del', 'delattr(', 'dict(', 'dir(',
'divmod('])

@unittest.skip("disabled while non-simple completion is disabled")
def test_substring_global_complete(self):
self.repl = FakeRepl({'autocomplete_mode': autocomplete.SUBSTRING})
self.set_input_line("time")

self.assertTrue(self.repl.complete())
self.assertTrue(hasattr(self.repl.completer, 'matches'))
self.assertEqual(self.repl.completer.matches,
self.assertTrue(hasattr(self.repl.matches_iter, 'matches'))
self.assertEqual(self.repl.matches_iter.matches,
['RuntimeError(', 'RuntimeWarning('])

@unittest.skip("disabled while non-simple completion is disabled")
def test_fuzzy_global_complete(self):
self.repl = FakeRepl({'autocomplete_mode': autocomplete.FUZZY})
self.set_input_line("doc")

self.assertTrue(self.repl.complete())
self.assertTrue(hasattr(self.repl.completer, 'matches'))
self.assertEqual(self.repl.completer.matches,
self.assertTrue(hasattr(self.repl.matches_iter, 'matches'))
self.assertEqual(self.repl.matches_iter.matches,
['UnboundLocalError(', '__doc__'])

# 2. Attribute tests
Expand All @@ -349,7 +347,6 @@ def test_simple_attribute_complete(self):
self.assertTrue(hasattr(self.repl.matches_iter, 'matches'))
self.assertEqual(self.repl.matches_iter.matches, ['Foo.bar'])

@unittest.skip("disabled while non-simple completion is disabled")
def test_substring_attribute_complete(self):
self.repl = FakeRepl({'autocomplete_mode': autocomplete.SUBSTRING})
self.set_input_line("Foo.az")
Expand All @@ -359,10 +356,9 @@ def test_substring_attribute_complete(self):
self.repl.push(line)

self.assertTrue(self.repl.complete())
self.assertTrue(hasattr(self.repl.completer, 'matches'))
self.assertEqual(self.repl.completer.matches, ['Foo.baz'])
self.assertTrue(hasattr(self.repl.matches_iter, 'matches'))
self.assertEqual(self.repl.matches_iter.matches, ['Foo.baz'])

@unittest.skip("disabled while non-simple completion is disabled")
def test_fuzzy_attribute_complete(self):
self.repl = FakeRepl({'autocomplete_mode': autocomplete.FUZZY})
self.set_input_line("Foo.br")
Expand All @@ -372,8 +368,8 @@ def test_fuzzy_attribute_complete(self):
self.repl.push(line)

self.assertTrue(self.repl.complete())
self.assertTrue(hasattr(self.repl.completer, 'matches'))
self.assertEqual(self.repl.completer.matches, ['Foo.bar'])
self.assertTrue(hasattr(self.repl.matches_iter, 'matches'))
self.assertEqual(self.repl.matches_iter.matches, ['Foo.bar'])

# 3. Edge Cases
def test_updating_namespace_complete(self):
Expand Down