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

Method check_file

Lib/test/audiotests.py:68–75  ·  view source on GitHub ↗
(self, testfile, nframes, frames)

Source from the content-addressed store, hash-verified

66 return f
67
68 def check_file(self, testfile, nframes, frames):
69 with self.module.open(testfile, 'rb') as f:
70 self.assertEqual(f.getnchannels(), self.nchannels)
71 self.assertEqual(f.getsampwidth(), self.sampwidth)
72 self.assertEqual(f.getframerate(), self.framerate)
73 self.assertEqual(f.getnframes(), nframes)
74 self.assertEqual(f.readframes(nframes), frames)
75 self.assertEqual(f.getformat(), self.format)
76
77 def test_write_params(self):
78 f = self.create_file(TESTFN)

Callers 11

test_writeMethod · 0.95
test_write_bytearrayMethod · 0.95
test_write_arrayMethod · 0.95
test_write_memoryviewMethod · 0.95
test_multiple_writesMethod · 0.95
test_overflowed_writeMethod · 0.95
test_unseekable_readMethod · 0.95
test_unseekable_writeMethod · 0.95

Calls 8

readframesMethod · 0.80
openMethod · 0.45
assertEqualMethod · 0.45
getnchannelsMethod · 0.45
getsampwidthMethod · 0.45
getframerateMethod · 0.45
getnframesMethod · 0.45
getformatMethod · 0.45

Tested by

no test coverage detected