| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2cfa83b commit c830c75
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -179,7 +179,7 @@ def setUp(self): | |||
| 179 | 179 | def test_list_win_visible_match_selected_on_tab_multiple_options(self): | |
| 180 | 180 | self.repl._current_line = " './'" | |
| 181 | 181 | self.repl._cursor_offset = 2 | |
| 182 | - with mock.patch('bpython.autocomplete.get_completer_bpython') as m: | ||
| 182 | + with mock.patch('bpython.autocomplete.get_completer') as m: | ||
| 183 | 183 | m.return_value = (['./abc', './abcd', './bcd'], | |
| 184 | 184 | autocomplete.FilenameCompletion()) | |
| 185 | 185 | self.repl.update_completion() | |
@@ -191,7 +191,7 @@ def test_list_win_visible_match_selected_on_tab_multiple_options(self): | |||
| 191 | 191 | def test_list_win_not_visible_and_cseq_if_cseq(self): | |
| 192 | 192 | self.repl._current_line = " './a'" | |
| 193 | 193 | self.repl._cursor_offset = 5 | |
| 194 | - with mock.patch('bpython.autocomplete.get_completer_bpython') as m: | ||
| 194 | + with mock.patch('bpython.autocomplete.get_completer') as m: | ||
| 195 | 195 | m.return_value = (['./abcd', './abce'], | |
| 196 | 196 | autocomplete.FilenameCompletion()) | |
| 197 | 197 | self.repl.update_completion() | |
@@ -204,7 +204,7 @@ def test_list_win_not_visible_and_cseq_if_cseq(self): | |||
| 204 | 204 | def test_list_win_not_visible_and_match_selected_if_one_option(self): | |
| 205 | 205 | self.repl._current_line = " './a'" | |
| 206 | 206 | self.repl._cursor_offset = 5 | |
| 207 | - with mock.patch('bpython.autocomplete.get_completer_bpython') as m: | ||
| 207 | + with mock.patch('bpython.autocomplete.get_completer') as m: | ||
| 208 | 208 | m.return_value = (['./abcd'], autocomplete.FilenameCompletion()) | |
| 209 | 209 | self.repl.update_completion() | |
| 210 | 210 | self.assertEqual(self.repl.list_win_visible, False) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -316,24 +316,22 @@ def test_simple_global_complete(self): | |||
| 316 | 316 | ['def', 'del', 'delattr(', 'dict(', 'dir(', | |
| 317 | 317 | 'divmod(']) | |
| 318 | 318 | ||
| 319 | - @unittest.skip("disabled while non-simple completion is disabled") | ||
| 320 | 319 | def test_substring_global_complete(self): | |
| 321 | 320 | self.repl = FakeRepl({'autocomplete_mode': autocomplete.SUBSTRING}) | |
| 322 | 321 | self.set_input_line("time") | |
| 323 | 322 | ||
| 324 | 323 | self.assertTrue(self.repl.complete()) | |
| 325 | - self.assertTrue(hasattr(self.repl.completer, 'matches')) | ||
| 326 | - self.assertEqual(self.repl.completer.matches, | ||
| 324 | + self.assertTrue(hasattr(self.repl.matches_iter, 'matches')) | ||
| 325 | + self.assertEqual(self.repl.matches_iter.matches, | ||
| 327 | 326 | ['RuntimeError(', 'RuntimeWarning(']) | |
| 328 | 327 | ||
| 329 | - @unittest.skip("disabled while non-simple completion is disabled") | ||
| 330 | 328 | def test_fuzzy_global_complete(self): | |
| 331 | 329 | self.repl = FakeRepl({'autocomplete_mode': autocomplete.FUZZY}) | |
| 332 | 330 | self.set_input_line("doc") | |
| 333 | 331 | ||
| 334 | 332 | self.assertTrue(self.repl.complete()) | |
| 335 | - self.assertTrue(hasattr(self.repl.completer, 'matches')) | ||
| 336 | - self.assertEqual(self.repl.completer.matches, | ||
| 333 | + self.assertTrue(hasattr(self.repl.matches_iter, 'matches')) | ||
| 334 | + self.assertEqual(self.repl.matches_iter.matches, | ||
| 337 | 335 | ['UnboundLocalError(', '__doc__']) | |
| 338 | 336 | ||
| 339 | 337 | # 2. Attribute tests | |
@@ -349,7 +347,6 @@ def test_simple_attribute_complete(self): | |||
| 349 | 347 | self.assertTrue(hasattr(self.repl.matches_iter, 'matches')) | |
| 350 | 348 | self.assertEqual(self.repl.matches_iter.matches, ['Foo.bar']) | |
| 351 | 349 | ||
| 352 | - @unittest.skip("disabled while non-simple completion is disabled") | ||
| 353 | 350 | def test_substring_attribute_complete(self): | |
| 354 | 351 | self.repl = FakeRepl({'autocomplete_mode': autocomplete.SUBSTRING}) | |
| 355 | 352 | self.set_input_line("Foo.az") | |
@@ -359,10 +356,9 @@ def test_substring_attribute_complete(self): | |||
| 359 | 356 | self.repl.push(line) | |
| 360 | 357 | ||
| 361 | 358 | self.assertTrue(self.repl.complete()) | |
| 362 | - self.assertTrue(hasattr(self.repl.completer, 'matches')) | ||
| 363 | - self.assertEqual(self.repl.completer.matches, ['Foo.baz']) | ||
| 359 | + self.assertTrue(hasattr(self.repl.matches_iter, 'matches')) | ||
| 360 | + self.assertEqual(self.repl.matches_iter.matches, ['Foo.baz']) | ||
| 364 | 361 | ||
| 365 | - @unittest.skip("disabled while non-simple completion is disabled") | ||
| 366 | 362 | def test_fuzzy_attribute_complete(self): | |
| 367 | 363 | self.repl = FakeRepl({'autocomplete_mode': autocomplete.FUZZY}) | |
| 368 | 364 | self.set_input_line("Foo.br") | |
@@ -372,8 +368,8 @@ def test_fuzzy_attribute_complete(self): | |||
| 372 | 368 | self.repl.push(line) | |
| 373 | 369 | ||
| 374 | 370 | self.assertTrue(self.repl.complete()) | |
| 375 | - self.assertTrue(hasattr(self.repl.completer, 'matches')) | ||
| 376 | - self.assertEqual(self.repl.completer.matches, ['Foo.bar']) | ||
| 371 | + self.assertTrue(hasattr(self.repl.matches_iter, 'matches')) | ||
| 372 | + self.assertEqual(self.repl.matches_iter.matches, ['Foo.bar']) | ||
| 377 | 373 | ||
| 378 | 374 | # 3. Edge Cases | |
| 379 | 375 | def test_updating_namespace_complete(self): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments