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

Method test_expect_exact_basic

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

Source from the content-addressed store, hash-verified

41 p.expect(pexpect.EOF)
42
43 def test_expect_exact_basic(self):
44 p = PopenSpawn('cat', timeout=5)
45 p.sendline(b'Hello')
46 p.sendline(b'there')
47 p.sendline(b'Mr. Python')
48 p.expect_exact(b'Hello')
49 p.expect_exact(b'there')
50 p.expect_exact(b'Mr. Python')
51 p.sendeof()
52 p.expect_exact(pexpect.EOF)
53
54 def test_expect(self):
55 the_old_way = subprocess.Popen(args=['ls', '-l', '/bin'],

Callers

nothing calls this directly

Calls 4

sendlineMethod · 0.95
sendeofMethod · 0.95
PopenSpawnClass · 0.90
expect_exactMethod · 0.80

Tested by

no test coverage detected