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

Method test_multiple_writes

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

Source from the content-addressed store, hash-verified

168 self.check_file(testfile, self.nframes, self.frames)
169
170 def test_multiple_writes(self):
171 with open(TESTFN, 'wb') as testfile:
172 testfile.write(b'ababagalamaga')
173 f = self.create_file(testfile)
174 f.setnframes(self.nframes)
175 framesize = self.nchannels * self.sampwidth
176 f.writeframes(self.frames[:-framesize])
177 f.writeframes(self.frames[-framesize:])
178 f.close()
179
180 with open(TESTFN, 'rb') as testfile:
181 self.assertEqual(testfile.read(13), b'ababagalamaga')
182 self.check_file(testfile, self.nframes, self.frames)
183
184 def test_overflowed_write(self):
185 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