def testBufferPartialRead(self): buf = Buffer() buf.write(self.tinydata) buf.close() d = buf.read(5) self.assertEqual(d, self.tinydata[:5]) d += buf.read() self.assertEqual(d, self.tinydata)
def testBufferFullRead(self): buf = Buffer() buf.write(self.tinydata) buf.close() d = buf.read() self.assertEqual(d, self.tinydata)