MCPcopy Index your code
hub / github.com/python/cpython / test_readline

Method test_readline

Lib/test/test_gzip.py:262–272  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

260 self.assertEqual(lines, 50 * data1.splitlines(keepends=True))
261
262 def test_readline(self):
263 self.test_write()
264 # Try .readline() with varying line lengths
265
266 with gzip.GzipFile(self.filename, 'rb') as f:
267 line_length = 0
268 while 1:
269 L = f.readline(line_length)
270 if not L and line_length != 0: break
271 self.assertTrue(len(L) <= line_length)
272 line_length = (line_length + 1) % 50
273
274 def test_readlines(self):
275 self.test_write()

Callers

nothing calls this directly

Calls 3

test_writeMethod · 0.95
assertTrueMethod · 0.80
readlineMethod · 0.45

Tested by

no test coverage detected