MCPcopy Index your code
hub / github.com/python/cpython / test_basic_completion

Method test_basic_completion

Lib/test/test_pdb.py:5009–5025  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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("""

Callers

nothing calls this directly

Calls 3

run_ptyFunction · 0.90
assertInMethod · 0.80
dedentMethod · 0.45

Tested by

no test coverage detected