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

Method test_copy

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

Source from the content-addressed store, hash-verified

298 f.setpos(f.getnframes() + 1)
299
300 def test_copy(self):
301 f = self.f = self.module.open(self.sndfilepath)
302 fout = self.fout = self.module.open(TESTFN, 'wb')
303 fout.setparams(f.getparams())
304 i = 0
305 n = f.getnframes()
306 while n > 0:
307 i += 1
308 fout.writeframes(f.readframes(i))
309 n -= i
310 fout.close()
311 fout = self.fout = self.module.open(TESTFN, 'rb')
312 f.rewind()
313 self.assertEqual(f.getparams(), fout.getparams())
314 self.assertEqual(f.readframes(f.getnframes()),
315 fout.readframes(fout.getnframes()))
316
317 def test_read_not_from_start(self):
318 with open(TESTFN, 'wb') as testfile:

Callers

nothing calls this directly

Calls 9

setparamsMethod · 0.80
writeframesMethod · 0.80
readframesMethod · 0.80
openMethod · 0.45
getparamsMethod · 0.45
getnframesMethod · 0.45
closeMethod · 0.45
rewindMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected