| 5007 | raise unittest.SkipTest("libedit readline is not supported for pdb") |
| 5008 | |
| 5009 | def test_basic_completion(self): |
| 5010 | script = textwrap.dedent(""" |
| 5011 | import pdb; pdb.Pdb().set_trace() |
| 5012 | # Concatenate strings so that the output doesn't appear in the source |
| 5013 | print('hello' + '!') |
| 5014 | """) |
| 5015 | |
| 5016 | # List everything starting with 'co', there should be multiple matches |
| 5017 | # then add ntin and complete 'contin' to 'continue' |
| 5018 | input = b"co\t\tntin\t\n" |
| 5019 | |
| 5020 | output = run_pty(script, input) |
| 5021 | |
| 5022 | self.assertIn(b'commands', output) |
| 5023 | self.assertIn(b'condition', output) |
| 5024 | self.assertIn(b'continue', output) |
| 5025 | self.assertIn(b'hello!', output) |
| 5026 | |
| 5027 | def test_expression_completion(self): |
| 5028 | script = textwrap.dedent(""" |