# HG changeset patch # User Amine Sehili # Date 1551535265 -3600 # Node ID ee883f8c372bd634950f21d49ef6573f21d82039 # Parent e91d97f7a63250ee21474390c50a735336618c34 Add tests for from_file with large_file=True diff -r e91d97f7a632 -r ee883f8c372b tests/test_io.py --- a/tests/test_io.py Thu Feb 28 20:48:10 2019 +0100 +++ b/tests/test_io.py Sat Mar 02 15:01:05 2019 +0100 @@ -12,6 +12,8 @@ AudioIOError, AudioParameterError, BufferAudioSource, + RawAudioSource, + WaveAudioSource, check_audio_data, _guess_audio_format, _normalize_use_channel, @@ -269,6 +271,19 @@ from_file(filename, audio_format, **kwargs) self.assertTrue(patch_function.called) + def test_from_file_large_file_raw(self, ): + filename = "tests/data/test_16KHZ_mono_400Hz.raw" + audio_source = from_file(filename, large_file=True, + sampling_rate=16000, + sample_width=2, + channels=1) + self.assertIsInstance(audio_source, RawAudioSource) + + def test_from_file_large_file_wave(self, ): + filename = "tests/data/test_16KHZ_mono_400Hz.wav" + audio_source = from_file(filename, large_file=True) + self.assertIsInstance(audio_source, WaveAudioSource) + @genty_dataset( missing_sampling_rate=("sr",), missing_sample_width=("sw",),