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

Method test_copy

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

Source from the content-addressed store, hash-verified

304 f.setpos(f.getnframes() + 1)
305
306 def test_copy(self):
307 if self.readonly:
308 self.skipTest('Read only file format')
309 f = self.f = self.module.open(self.sndfilepath)
310 fout = self.fout = self.module.open(TESTFN, 'wb')
311 fout.setparams(f.getparams())
312 i = 0
313 n = f.getnframes()
314 while n > 0:
315 i += 1
316 fout.writeframes(f.readframes(i))
317 n -= i
318 fout.close()
319 fout = self.fout = self.module.open(TESTFN, 'rb')
320 f.rewind()
321 self.assertEqual(f.getparams(), fout.getparams())
322 self.assertEqual(f.readframes(f.getnframes()),
323 fout.readframes(fout.getnframes()))
324
325 def test_read_not_from_start(self):
326 with open(TESTFN, 'wb') as testfile:

Callers

nothing calls this directly

Calls 10

skipTestMethod · 0.80
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