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

Method test_expect_basic

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

Source from the content-addressed store, hash-verified

30class ExpectTestCase (PexpectTestCase.PexpectTestCase):
31
32 def test_expect_basic(self):
33 p = PopenSpawn('cat', timeout=5)
34 p.sendline(b'Hello')
35 p.sendline(b'there')
36 p.sendline(b'Mr. Python')
37 p.expect(b'Hello')
38 p.expect(b'there')
39 p.expect(b'Mr. Python')
40 p.sendeof()
41 p.expect(pexpect.EOF)
42
43 def test_expect_exact_basic(self):
44 p = PopenSpawn('cat', timeout=5)

Callers

nothing calls this directly

Calls 4

sendlineMethod · 0.95
sendeofMethod · 0.95
PopenSpawnClass · 0.90
expectMethod · 0.80

Tested by

no test coverage detected