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

Method test_unseekable_overflowed_write

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

Source from the content-addressed store, hash-verified

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:
238 testfile.write(b'ababagalamaga')
239 f = self.create_file(testfile)
240 f.setnframes(self.nframes - 1)
241 try:
242 f.writeframes(self.frames)
243 except OSError:
244 pass
245 try:
246 f.close()
247 except OSError:
248 pass
249
250 with open(TESTFN, 'rb') as testfile:
251 self.assertEqual(testfile.read(13), b'ababagalamaga')
252 framesize = self.nchannels * self.sampwidth
253 self.check_file(testfile, self.nframes - 1, self.frames[:-framesize])
254
255
256class AudioTestsWithSourceFile(AudioTests):

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