spawn.writelines()
(self)
| 153 | self.assertEqual(child.readline(), b'a\r\n') |
| 154 | |
| 155 | def test_writelines(self): |
| 156 | " spawn.writelines() " |
| 157 | child = pexpect.spawn('cat') |
| 158 | # notice that much like file.writelines, we do not delimit by newline |
| 159 | # -- it is equivalent to calling write(''.join([args,])) |
| 160 | child.writelines(['abc', '123', 'xyz', '\r']) |
| 161 | child.sendeof() |
| 162 | line = child.readline() |
| 163 | assert line == b'abc123xyz\r\n' |
| 164 | |
| 165 | def test_eof(self): |
| 166 | " call to expect() after EOF is received raises pexpect.EOF " |
nothing calls this directly
no test coverage detected