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

Method test_set_complete_delims

Lib/test/test_readline.py:209–226  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

207 self.assertIn(b"History length: 0", output)
208
209 def test_set_complete_delims(self):
210 script = textwrap.dedent("""
211 import readline
212 def complete(text, state):
213 if state == 0 and text == "$":
214 return "$complete"
215 return None
216 if readline.backend == "editline":
217 readline.parse_and_bind(r'bind "\\t" rl_complete')
218 else:
219 readline.parse_and_bind(r'"\\t": complete')
220 readline.set_completer_delims(" \\t\\n")
221 readline.set_completer(complete)
222 print(input())
223 """)
224
225 output = run_pty(script, input=b"$\t\n")
226 self.assertIn(b"$complete", output)
227
228 def test_nonascii(self):
229 loc = locale.setlocale(locale.LC_CTYPE, None)

Callers

nothing calls this directly

Calls 3

run_ptyFunction · 0.90
assertInMethod · 0.80
dedentMethod · 0.45

Tested by

no test coverage detected