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

Method test_read1

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

Source from the content-addressed store, hash-verified

129 self.assertEqual(d, data1*50)
130
131 def test_read1(self):
132 self.test_write()
133 blocks = []
134 nread = 0
135 with gzip.GzipFile(self.filename, 'r') as f:
136 while True:
137 d = f.read1()
138 if not d:
139 break
140 blocks.append(d)
141 nread += len(d)
142 # Check that position was updated correctly (see issue10791).
143 self.assertEqual(f.tell(), nread)
144 self.assertEqual(b''.join(blocks), data1 * 50)
145
146 def test_readinto(self):
147 # 10MB of uncompressible data to ensure multiple reads

Callers

nothing calls this directly

Calls 6

test_writeMethod · 0.95
read1Method · 0.45
appendMethod · 0.45
assertEqualMethod · 0.45
tellMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected