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

Method test_multiple_writes

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

Source from the content-addressed store, hash-verified

174 self.check_file(testfile, self.nframes, self.frames)
175
176 def test_multiple_writes(self):
177 with open(TESTFN, 'wb') as testfile:
178 testfile.write(b'ababagalamaga')
179 f = self.create_file(testfile)
180 f.setnframes(self.nframes)
181 framesize = self.nchannels * self.sampwidth
182 f.writeframes(self.frames[:-framesize])
183 f.writeframes(self.frames[-framesize:])
184 f.close()
185
186 with open(TESTFN, 'rb') as testfile:
187 self.assertEqual(testfile.read(13), b'ababagalamaga')
188 self.check_file(testfile, self.nframes, self.frames)
189
190 def test_overflowed_write(self):
191 with open(TESTFN, 'wb') as testfile:

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected