MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_readline

Method test_readline

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

test_writeMethod · 0.95
lenFunction · 0.85
assertTrueMethod · 0.80
readlineMethod · 0.45

Tested by

no test coverage detected