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

Method test_unseekable_incompleted_write

Lib/test/audiotests.py:218–234  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

216 self.check_file(TESTFN, self.nframes, self.frames)
217
218 def test_unseekable_incompleted_write(self):
219 with UnseekableIO(TESTFN, 'wb') as testfile:
220 testfile.write(b'ababagalamaga')
221 f = self.create_file(testfile)
222 f.setnframes(self.nframes + 1)
223 try:
224 f.writeframes(self.frames)
225 except OSError:
226 pass
227 try:
228 f.close()
229 except OSError:
230 pass
231
232 with open(TESTFN, 'rb') as testfile:
233 self.assertEqual(testfile.read(13), b'ababagalamaga')
234 self.check_file(testfile, self.nframes + 1, self.frames)
235
236 def test_unseekable_overflowed_write(self):
237 with UnseekableIO(TESTFN, 'wb') as testfile:

Callers

nothing calls this directly

Calls 10

create_fileMethod · 0.95
check_fileMethod · 0.95
setnframesMethod · 0.80
writeframesMethod · 0.80
UnseekableIOClass · 0.70
openFunction · 0.50
writeMethod · 0.45
closeMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected