diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2015-07-27 21:06:31 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2015-07-27 21:06:31 (GMT) |
commit | aaf6114b37df5b86d605e396ac0547e5cac492ae (patch) | |
tree | 513580c79737d68cf26ea85280895c266f421f97 /Lib/test/test_rlcompleter.py | |
parent | 0bd5fb0112b26310cc9db8ac92ce6936385be26c (diff) | |
download | cpython-aaf6114b37df5b86d605e396ac0547e5cac492ae.zip cpython-aaf6114b37df5b86d605e396ac0547e5cac492ae.tar.gz cpython-aaf6114b37df5b86d605e396ac0547e5cac492ae.tar.bz2 |
Issue #23441: rcompleter now prints a tab character instead of displaying
possible completions for an empty word.
Initial patch by Martin Sekera.
Diffstat (limited to 'Lib/test/test_rlcompleter.py')
-rw-r--r-- | Lib/test/test_rlcompleter.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_rlcompleter.py b/Lib/test/test_rlcompleter.py index 11a7bd2..2da7fce 100644 --- a/Lib/test/test_rlcompleter.py +++ b/Lib/test/test_rlcompleter.py @@ -1,4 +1,3 @@ -from test import support import unittest import builtins import rlcompleter @@ -65,9 +64,14 @@ class TestRlcompleter(unittest.TestCase): ['egg.{}('.format(x) for x in dir(str) if x.startswith('s')]) -def test_main(): - support.run_unittest(TestRlcompleter) + def test_complete(self): + completer = rlcompleter.Completer() + self.assertEqual(completer.complete('', 0), '\t') + self.assertEqual(completer.complete('a', 0), 'and') + self.assertEqual(completer.complete('a', 1), 'as') + self.assertEqual(completer.complete('as', 2), 'assert') + self.assertEqual(completer.complete('an', 0), 'and') if __name__ == '__main__': - test_main() + unittest.main() |