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

Method test_readlines

tests/test_misc.py:136–146  ·  view source on GitHub ↗

reading all lines of spawn.readlines().

(self)

Source from the content-addressed store, hash-verified

134 assert page == b'abc\r\n123\r\n'
135
136 def test_readlines(self):
137 " reading all lines of spawn.readlines(). "
138 child = pexpect.spawn('cat', echo=False)
139 child.sendline("abc")
140 child.sendline("123")
141 child.sendeof()
142 page = b''.join(child.readlines()).replace(_CAT_EOF, b'')
143 assert page == b'abc\r\n123\r\n'
144 child.expect(pexpect.EOF)
145 assert not child.isalive()
146 assert child.exitstatus == 0
147
148 def test_write(self):
149 " write a character and return it in return. "

Callers

nothing calls this directly

Calls 6

readlinesMethod · 0.80
expectMethod · 0.80
spawnMethod · 0.45
sendlineMethod · 0.45
sendeofMethod · 0.45
isaliveMethod · 0.45

Tested by

no test coverage detected