Lines Matching refs:aifc
9 import aifc
15 module = aifc
149 module = aifc
154 self.f = aifc.open(findfile('Sine-1000Hz-300ms.aif'))
159 with self.assertRaises(aifc.Error):
162 self.f = aifc.open(non_aifc_file, 'rb')
166 with mock.patch.object(aifc.Aifc_write, 'initfp',
169 self.fout = aifc.open(TESTFN, 'wb')
172 f = self.f = aifc.open(TESTFN, 'wb')
177 f = self.f = aifc.open(TESTFN, 'rb')
188 fout = aifc.open(io.BytesIO(), 'wb')
197 fout = aifc.open(io.BytesIO(), 'wb')
206 fout = self.fout = aifc.open(TESTFN, 'wb')
213 f = self.f = aifc.open(TESTFN, 'rb')
217 self.assertRaises(aifc.Error, f.getmark, 3)
225 getattr(aifc, '_write_' + what)(f, x)
227 return getattr(aifc, '_read_' + what)(f)
231 self.assertEqual(read_written(x, 'float'), aifc._HUGE_VAL)
245 self.assertRaises(EOFError, aifc._read_ulong, f)
246 self.assertRaises(EOFError, aifc._read_long, f)
247 self.assertRaises(EOFError, aifc._read_ushort, f)
248 self.assertRaises(EOFError, aifc._read_short, f)
253 aifc._write_string(f, b'too long' * 255)
256 with self.assertRaises(aifc.Error):
257 aifc.open(TESTFN, 'wrong_mode')
262 self.assertRaises(aifc.Error, aifc.open, b1)
263 self.assertRaises(aifc.Error, aifc.open, b2)
267 self.assertRaises(aifc.Error, aifc.open, b)
274 with self.assertRaisesRegex(aifc.Error, 'COMM chunk and/or SSND chunk'
276 aifc.open(io.BytesIO(b))
283 self.assertRaises(aifc.Error, aifc.open, io.BytesIO(b))
292 with self.assertRaisesRegex(aifc.Error, 'bad # of channels'):
293 aifc.open(io.BytesIO(b))
302 with self.assertRaisesRegex(aifc.Error, 'bad sample width'):
303 aifc.open(io.BytesIO(b))
312 f = aifc.open(io.BytesIO(b))
324 f = aifc.open(io.BytesIO(b))
335 f = aifc.open(io.BytesIO(b))
340 fout = aifc.open(io.BytesIO(), 'wb')
342 self.assertRaises(aifc.Error, fout.setparams, wrong_params)
343 self.assertRaises(aifc.Error, fout.getparams)
344 self.assertRaises(aifc.Error, fout.setnchannels, 0)
345 self.assertRaises(aifc.Error, fout.getnchannels)
346 self.assertRaises(aifc.Error, fout.setsampwidth, 0)
347 self.assertRaises(aifc.Error, fout.getsampwidth)
348 self.assertRaises(aifc.Error, fout.setframerate, 0)
349 self.assertRaises(aifc.Error, fout.getframerate)
350 self.assertRaises(aifc.Error, fout.setcomptype, b'WRNG', '')
357 self.assertRaises(aifc.Error, fout.setparams, (1, 1, 1, 1, 1, 1))
358 self.assertRaises(aifc.Error, fout.setnchannels, 1)
359 self.assertRaises(aifc.Error, fout.setsampwidth, 1)
360 self.assertRaises(aifc.Error, fout.setframerate, 1)
361 self.assertRaises(aifc.Error, fout.setnframes, 1)
362 self.assertRaises(aifc.Error, fout.setcomptype, b'NONE', '')
363 self.assertRaises(aifc.Error, fout.aiff)
364 self.assertRaises(aifc.Error, fout.aifc)
367 fout = aifc.open(io.BytesIO(), 'wb')
368 fout.aifc()
386 fout = aifc.open(io.BytesIO(), 'wb')
387 fout.aifc()
394 fout = aifc.open(io.BytesIO(), 'wb')
395 self.assertRaises(aifc.Error, fout.close)
396 fout = aifc.open(io.BytesIO(), 'wb')
398 self.assertRaises(aifc.Error, fout.close)
399 fout = aifc.open(io.BytesIO(), 'wb')
402 self.assertRaises(aifc.Error, fout.close)
406 fout = aifc.open(io.BytesIO(), 'wb')
409 self.assertRaises(aifc.Error, fout.close)
413 fout = aifc.open(io.BytesIO(), 'wb')
414 self.assertRaises(aifc.Error, fout.setmark, 0, 0, b'')
415 self.assertRaises(aifc.Error, fout.setmark, 1, -1, b'')
416 self.assertRaises(aifc.Error, fout.setmark, 1, 0, None)
417 self.assertRaises(aifc.Error, fout.getmark, 1)
423 fout = self.fout = aifc.open(filename, 'wb')
429 f = self.f = aifc.open(filename, 'rb')