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

Method test_getformat_setformat

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

Source from the content-addressed store, hash-verified

218 self.assertEqual(params, (1, 4, 22050, 0, 'NONE', 'not compressed'))
219
220 def test_getformat_setformat(self):
221 with tempfile.NamedTemporaryFile(delete_on_close=False) as fp:
222 filename = fp.name
223 self.addCleanup(unlink, filename)
224
225 with wave.open(filename, 'wb') as w:
226 w.setnchannels(1)
227 w.setsampwidth(4)
228 w.setframerate(22050)
229 self.assertEqual(w.getformat(), wave.WAVE_FORMAT_PCM)
230 w.setformat(wave.WAVE_FORMAT_IEEE_FLOAT)
231 self.assertEqual(w.getformat(), wave.WAVE_FORMAT_IEEE_FLOAT)
232
233 def test_setformat_ieee_requires_32_or_64_bit_sampwidth(self):
234 with tempfile.NamedTemporaryFile(delete_on_close=False) as fp:

Callers

nothing calls this directly

Calls 8

addCleanupMethod · 0.80
setnchannelsMethod · 0.80
setsampwidthMethod · 0.80
setframerateMethod · 0.80
setformatMethod · 0.80
openMethod · 0.45
assertEqualMethod · 0.45
getformatMethod · 0.45

Tested by

no test coverage detected