reading all lines of spawn.readlines().
(self)
| 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. " |