# HG changeset patch # User Amine Sehili # Date 1549913331 -3600 # Node ID 4d290493f59097718503d64459cf4a09ed380808 # Parent 0125bd4ee31779b7d880d3d3d85609c0f807a6f9 Effectively call to_file in test_to_file_raw and test_to_file_wave diff -r 0125bd4ee317 -r 4d290493f590 tests/test_io.py --- a/tests/test_io.py Mon Feb 11 20:19:46 2019 +0100 +++ b/tests/test_io.py Mon Feb 11 20:28:51 2019 +0100 @@ -22,6 +22,7 @@ from_file, _save_raw, _save_wave, + to_file, ) @@ -577,7 +578,7 @@ tmpdir = TemporaryDirectory() filename = os.path.join(tmpdir.name, filename) data = _array_to_bytes(PURE_TONE_DICT[400]) - _save_raw(filename, data) + to_file(data, filename, audio_format=audio_format) self.assertTrue(filecmp.cmp(filename, exp_filename, shallow=False)) tmpdir.cleanup() @@ -589,13 +590,18 @@ wave_with_extension=("audio.wave", None), wave_with_audio_format_and_extension=("audio.mp3", "wave"), ) - def test_to_file_wav(self, filename, audio_format): + def test_to_file_wave(self, filename, audio_format): exp_filename = "tests/data/test_16KHZ_mono_400Hz.wav" tmpdir = TemporaryDirectory() filename = os.path.join(tmpdir.name, filename) data = _array_to_bytes(PURE_TONE_DICT[400]) - _save_wave( - filename, data, sampling_rate=16000, sample_width=2, channels=1 + to_file( + data, + filename, + audio_format=audio_format, + sampling_rate=16000, + sample_width=2, + channels=1, ) self.assertTrue(filecmp.cmp(filename, exp_filename, shallow=False)) tmpdir.cleanup()