def test_make_stream_reader_writer(self):
f = io.BytesIO(b'Hello')
s = iotools.make_stream('foo', f, '+b', buffering=1)
self.assertIsInstance(s, io.BufferedRandom)
self.assertEqual(s.read(), b'Hello')
s.write(b' World')
self.assertEqual(f.getvalue(), b'Hello World')
评论列表
文章目录