def test_readline(self): buf = BytesIO() mb = MemoryBuffer(self.data) io = IOBuffer(mb) while 1: out = io.readline() if not out: break buf.write(out) self.assertEqual(out, self._data) self.assertEqual(buf.getvalue(), self.data)
def test_readline(self): buf = StringIO() mb = MemoryBuffer(self.data) io = IOBuffer(mb) while 1: out = io.readline() if not out: break buf.write(out) assert out == self._data assert buf.getvalue() == self.data