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

Method test_async_replwrap_multiline

tests/test_async.py:72–87  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

70 assert "real" in res, res
71
72 async def test_async_replwrap_multiline(self):
73 bash = replwrap.bash()
74 res = await bash.run_command("echo '1 2\n3 4'", async_=True)
75 self.assertEqual(res.strip().splitlines(), ["1 2", "3 4"])
76
77 # Should raise ValueError if input is incomplete
78 try:
79 await bash.run_command("echo '5 6", async_=True)
80 except ValueError:
81 pass
82 else:
83 assert False, "Didn't raise ValueError for incomplete input"
84
85 # Check that the REPL was reset (SIGINT) after the incomplete input
86 res = await bash.run_command("echo '1 2\n3 4'", async_=True)
87 self.assertEqual(res.strip().splitlines(), ["1 2", "3 4"])

Callers

nothing calls this directly

Calls 1

run_commandMethod · 0.80

Tested by

no test coverage detected