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)
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)
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)