Example #1
0
 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)
Example #2
0
 def testBufferFullRead(self):
     buf = Buffer()
     buf.write(self.tinydata)
     buf.close()
     d = buf.read()
     self.assertEqual(d, self.tinydata)