MCPcopy Create free account
hub / github.com/pexpect/pexpect / test_existing_spawn

Method test_existing_spawn

tests/test_replwrap.py:89–98  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

87 self.assertEqual(res.strip().splitlines(), ['1 2', '3 4'])
88
89 def test_existing_spawn(self):
90 child = pexpect.spawn("bash", timeout=5, encoding='utf-8')
91 repl = replwrap.REPLWrapper(child, re.compile('[$#]'),
92 "PS1='{0}' PS2='{1}' "
93 "PROMPT_COMMAND=''")
94
95 print(repl)
96 res = repl.run_command("echo $HOME")
97 print(res)
98 assert res.startswith('/'), res
99
100 def test_zsh(self):
101 zsh = replwrap.zsh()

Callers

nothing calls this directly

Calls 2

run_commandMethod · 0.95
spawnMethod · 0.45

Tested by

no test coverage detected