fixed compressing file reader test

This commit is contained in:
John Dickinson 2010-10-04 16:59:10 -05:00
parent 0ca5286ad9
commit 42cc1352cc

View File

@ -25,8 +25,9 @@ class TestCompressingFileReader(unittest.TestCase):
def test_read(self): def test_read(self):
plain = 'obj\ndata' plain = 'obj\ndata'
s = cStringIO.StringIO(plain) s = cStringIO.StringIO(plain)
expected = '\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff'\ expected = '\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\xcaO\xca\xe2JI,'\
'\xcaO\xca\xe2JI,I\x04\x00\x00\x00\xff\xff' 'I\x04\x00\x00\x00\xff\xff\x03\x00P(\xa8\x1f\x08\x00\x00'\
'\x00'
x = CompressingFileReader(s) x = CompressingFileReader(s)
compressed = ''.join(iter(lambda: x.read(), '')) compressed = ''.join(iter(lambda: x.read(), ''))
self.assertEquals(compressed, expected) self.assertEquals(compressed, expected)