Пример #1
0
 def test_limited_chunk_readlines_fail(self):
     f = LimitedFile(self.fd, 25)
     self.assertEquals(f.readlines(25), ['0123456789\n', 'ABCDEFGHIJ\n', 'KLM'])
     self.assertRaises(LimitedFileSizeOverflow, f.readlines, 25)
     self.assertEquals(f.total, 26)
Пример #2
0
 def test_default_readlines(self):
     f = LimitedFile(self.fd)
     self.assertEquals(f.readlines(), ['0123456789\n', 'ABCDEFGHIJ\n', 'KLMNOPQRST'])
     self.assertEquals(f.readlines(), [])
     self.assertEquals(f.total, 32)
Пример #3
0
 def test_limited_chunk_readlines_pass(self):
     f = LimitedFile(self.fd, 25)
     self.assertEquals(f.readlines(25), ['0123456789\n', 'ABCDEFGHIJ\n', 'KLM'])
     self.assertEquals(f.total, 25)