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

Method test_read_getformat

Lib/test/test_wave.py:272–277  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

270 self.assertEqual(w.getsampwidth(), 8)
271
272 def test_read_getformat(self):
273 b = b'RIFF' + struct.pack('<L', 36) + b'WAVE'
274 b += b'fmt ' + struct.pack('<LHHLLHH', 16, 1, 1, 11025, 11025, 1, 8)
275 b += b'data' + struct.pack('<L', 0)
276 with wave.open(io.BytesIO(b), 'rb') as r:
277 self.assertEqual(r.getformat(), wave.WAVE_FORMAT_PCM)
278
279 def test_read_no_chunks(self):
280 b = b'SPAM'

Callers

nothing calls this directly

Calls 4

packMethod · 0.45
openMethod · 0.45
assertEqualMethod · 0.45
getformatMethod · 0.45

Tested by

no test coverage detected