changeset 141:995a568e6eff

Add test for save_with_pydub
author Amine Sehili <amine.sehili@gmail.com>
date Sun, 17 Feb 2019 14:02:45 +0100
parents b5a2da2e61f9
children d42c0c2858c5
files tests/test_io.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_io.py	Sat Feb 16 18:25:26 2019 +0100
+++ b/tests/test_io.py	Sun Feb 17 14:02:45 2019 +0100
@@ -22,6 +22,7 @@
     from_file,
     _save_raw,
     _save_wave,
+    _save_with_pydub,
     to_file,
 )
 
@@ -578,6 +579,11 @@
             srate, swidth, channels, _ = _get_audio_parameters(params)
             _save_wave(b"\0\0", "audio", srate, swidth, channels)
 
+    def test_save_with_pydub(self):
+        with patch("auditok.io.AudioSegment.export") as export:
+            _save_with_pydub(b"\0\0", "audio.org", "ogg", 16000, 2, 1)
+            self.assertTrue(export.called)
+
     @genty_dataset(
         raw_with_audio_format=("audio", "raw"),
         raw_with_extension=("audio.raw", None),