add a test that feed/read can happen piecemeal
This commit is contained in:
Robey Pointer 2006-04-11 15:48:06 -07:00
parent b7a615d02a
commit 22db02c82f
1 changed files with 6 additions and 0 deletions

View File

@ -47,6 +47,12 @@ class BufferedPipeTest (unittest.TestCase):
self.assert_(p.read_ready()) self.assert_(p.read_ready())
data = p.read(6) data = p.read(6)
self.assertEquals('hello.', data) self.assertEquals('hello.', data)
p.feed('plus/minus')
self.assertEquals('plu', p.read(3))
self.assertEquals('s/m', p.read(3))
self.assertEquals('inus', p.read(4))
p.close() p.close()
self.assert_(not p.read_ready()) self.assert_(not p.read_ready())
self.assertEquals('', p.read(1)) self.assertEquals('', p.read(1))