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

Method test_eof

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

Source from the content-addressed store, hash-verified

30 assert await p.expect(["foo", pexpect.TIMEOUT], timeout=1, async_=True) == 1
31
32 async def test_eof(self):
33 p = pexpect.spawn("cat")
34 p.sendline("Hi")
35 p.sendeof()
36 assert await p.expect(pexpect.EOF, async_=True) == 0
37
38 p = pexpect.spawn("cat")
39 p.sendeof()
40 with self.assertRaises(pexpect.EOF):
41 await p.expect("Blah", async_=True)
42
43 async def test_expect_exact(self):
44 p = pexpect.spawn("%s list100.py" % self.PYTHONBIN)

Callers

nothing calls this directly

Calls 5

expectMethod · 0.80
assertRaisesMethod · 0.80
spawnMethod · 0.45
sendlineMethod · 0.45
sendeofMethod · 0.45

Tested by

no test coverage detected