Lines Matching refs:aifc

9 import aifc
14 module = aifc
130 self.f = aifc.open(findfile('Sine-1000Hz-300ms.aif'))
135 class Aifc(aifc.Aifc_read):
140 with self.assertRaises(aifc.Error):
141 aifc.Aifc_read.__init__(a, non_aifc_file)
145 fout = aifc.open(io.BytesIO(), 'wb')
154 fout = self.fout = aifc.open(TESTFN, 'wb')
161 f = self.f = aifc.open(TESTFN, 'rb')
165 self.assertRaises(aifc.Error, f.getmark, 3)
173 getattr(aifc, '_write_' + what)(f, x)
175 return getattr(aifc, '_read_' + what)(f)
179 self.assertEqual(read_written(x, 'float'), aifc._HUGE_VAL)
193 self.assertRaises(EOFError, aifc._read_ulong, f)
194 self.assertRaises(EOFError, aifc._read_long, f)
195 self.assertRaises(EOFError, aifc._read_ushort, f)
196 self.assertRaises(EOFError, aifc._read_short, f)
201 aifc._write_string(f, 'too long' * 255)
204 with self.assertRaises(aifc.Error):
205 aifc.open(TESTFN, 'wrong_mode')
210 self.assertRaises(aifc.Error, aifc.open, b1)
211 self.assertRaises(aifc.Error, aifc.open, b2)
215 self.assertRaises(aifc.Error, aifc.open, b)
221 with self.assertRaisesRegexp(aifc.Error, 'COMM chunk and/or SSND chunk'
223 aifc.open(io.BytesIO(b))
229 self.assertRaises(aifc.Error, aifc.open, io.BytesIO(b))
237 f = aifc.open(io.BytesIO(b))
248 f = aifc.open(io.BytesIO(b))
258 f = aifc.open(io.BytesIO(b))
263 fout = aifc.open(io.BytesIO(), 'wb')
265 self.assertRaises(aifc.Error, fout.setparams, wrong_params)
266 self.assertRaises(aifc.Error, fout.getparams)
267 self.assertRaises(aifc.Error, fout.setnchannels, 0)
268 self.assertRaises(aifc.Error, fout.getnchannels)
269 self.assertRaises(aifc.Error, fout.setsampwidth, 0)
270 self.assertRaises(aifc.Error, fout.getsampwidth)
271 self.assertRaises(aifc.Error, fout.setframerate, 0)
272 self.assertRaises(aifc.Error, fout.getframerate)
273 self.assertRaises(aifc.Error, fout.setcomptype, 'WRNG', '')
280 self.assertRaises(aifc.Error, fout.setparams, (1, 1, 1, 1, 1, 1))
281 self.assertRaises(aifc.Error, fout.setnchannels, 1)
282 self.assertRaises(aifc.Error, fout.setsampwidth, 1)
283 self.assertRaises(aifc.Error, fout.setframerate, 1)
284 self.assertRaises(aifc.Error, fout.setnframes, 1)
285 self.assertRaises(aifc.Error, fout.setcomptype, 'NONE', '')
286 self.assertRaises(aifc.Error, fout.aiff)
287 self.assertRaises(aifc.Error, fout.aifc)
290 fout = aifc.open(io.BytesIO(), 'wb')
291 fout.aifc()
309 fout = aifc.open(io.BytesIO(), 'wb')
310 fout.aifc()
317 fout = aifc.open(io.BytesIO(), 'wb')
318 self.assertRaises(aifc.Error, fout.close)
319 fout = aifc.open(io.BytesIO(), 'wb')
321 self.assertRaises(aifc.Error, fout.close)
322 fout = aifc.open(io.BytesIO(), 'wb')
325 self.assertRaises(aifc.Error, fout.close)
329 fout = aifc.open(io.BytesIO(), 'wb')
332 self.assertRaises(aifc.Error, fout.close)
336 fout = aifc.open(io.BytesIO(), 'wb')
337 self.assertRaises(aifc.Error, fout.setmark, 0, 0, '')
338 self.assertRaises(aifc.Error, fout.setmark, 1, -1, '')
339 self.assertRaises(aifc.Error, fout.setmark, 1, 0, None)
340 self.assertRaises(aifc.Error, fout.getmark, 1)
348 fout = self.fout = aifc.open(filename, 'wb')
354 f = self.f = aifc.open(filename, 'rb')